Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Edgecore][as4500-52p][as4581-52p] Add new platform #285

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ K_PATCH_SERIES=series.arm64

include ../../kconfig.mk
K_CONFIG := arm64-all.config
K_BUILD_TARGET := Image Image.gz freescale/fsl-ls1043a-rdb.dtb freescale/fsl-ls1046a-rdb-sdk.dtb freescale/fsl-ls2080a-rdb.dtb freescale/fsl-ls2088a-rdb.dtb freescale/fsl-ls1088a-rdb.dtb marvell/accton-as4224.dtb marvell/accton-as5114.dtb marvell/accton-as4564-26p.dtb marvell/delta-tn48m.dtb marvell/delta-tn4810m.dtb marvell/delta-tn48m-dn.dtb marvell/delta-tn4810m-dn.dtb marvell/delta-tn48m2-swdev.dtb
K_BUILD_TARGET := Image Image.gz freescale/fsl-ls1043a-rdb.dtb freescale/fsl-ls1046a-rdb-sdk.dtb freescale/fsl-ls2080a-rdb.dtb freescale/fsl-ls2088a-rdb.dtb freescale/fsl-ls1088a-rdb.dtb marvell/accton-as4224.dtb marvell/accton-as5114.dtb marvell/accton-as4564-26p.dtb marvell/accton-as4500-52p.dtb marvell/delta-tn48m.dtb marvell/delta-tn4810m.dtb marvell/delta-tn48m-dn.dtb marvell/delta-tn4810m-dn.dtb marvell/delta-tn48m2-swdev.dtb freescale/accton-as4581-52pl.dtb
K_COPY_SRC := arch/arm64/boot/Image
K_COPY_GZIP := 1
ifndef K_COPY_DST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2597,7 +2597,7 @@ CONFIG_USB_NET_DRIVERS=y
# CONFIG_USB_PEGASUS is not set
# CONFIG_USB_RTL8150 is not set
# CONFIG_USB_RTL8152 is not set
# CONFIG_USB_LAN78XX is not set
CONFIG_USB_LAN78XX=y
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need this? Does this device use an USB-LAN adapter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as4560 use this USB-LAN adapter

CONFIG_USB_USBNET=y
CONFIG_USB_NET_AX8817X=y
CONFIG_USB_NET_AX88179_178A=y
Expand Down Expand Up @@ -4285,6 +4285,7 @@ CONFIG_DUMMY_CONSOLE=y
CONFIG_DUMMY_CONSOLE_COLUMNS=80
CONFIG_DUMMY_CONSOLE_ROWS=25
CONFIG_FRAMEBUFFER_CONSOLE=y
# CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION is not set
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
# CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER is not set
Expand Down Expand Up @@ -5985,6 +5986,10 @@ CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND=y
CONFIG_FSL_ERRATUM_A008585=y
CONFIG_HISILICON_ERRATUM_161010101=y
# CONFIG_ARM64_ERRATUM_2441009 is not set
# CONFIG_ARM64_ERRATUM_1742098 is not set
# CONFIG_ARM64_ERRATUM_2441007 is not set
# CONFIG_ARM64_ERRATUM_2457168 is not set
CONFIG_ARM64_ERRATUM_858921=y
CONFIG_SUN50I_ERRATUM_UNKNOWN1=y
CONFIG_ARM_TIMER_SP804=y
Expand Down
2 changes: 1 addition & 1 deletion packages/base/any/kernels/5.15-lts/kconfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ K_PATCH_DIR := $(THIS_DIR)/patches
K_MODSYNCLIST := tools/objtool
K_GIT := 1
K_GIT_URL := https://github.com/dentproject/linux.git
K_GIT_BRANCH := dent-linux-5.15.y
K_GIT_BRANCH := dent-linux-5.15.105
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be part of this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I know if there is any plan to change default branch to "dent-linux-5.15.105"?

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*arm64*accton*as4500*52p.mk
onlpdump.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(ONL)/make/pkg.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(ONL)/make/pkg.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!include $ONL_TEMPLATES/platform-modules.yml ARCH=arm64 VENDOR=accton BASENAME=arm64-accton-as4500-52p KERNELS="onl-kernel-5.15-lts-arm64-all:arm64"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
KERNELS := onl-kernel-5.15-lts-arm64-all:arm64
KMODULES := $(ONL)/packages/platforms/accton/arm64/as45xx-52p/src/modules/
VENDOR := accton
BASENAME := arm64-accton-as4500-52p
ARCH := arm64
include $(ONL)/make/kmodule.mk
export CROSS_COMPILE=aarch64-linux-gnu-
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(ONL)/make/pkg.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!include $ONL_TEMPLATES/onlp-platform-any.yml PLATFORM=arm64-accton-as4500-52p ARCH=arm64 TOOLCHAIN=aarch64-linux-gnu
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FILTER=src
include $(ONL)/make/subdirs.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PLATFORM := arm64-accton-as4500-52p
PLATFORM_MODULE := arm64_accton_as45xx_52p
include $(ONL)/packages/base/any/onlp/builds/platform/libonlp-platform.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PLATFORM := arm64-accton-as4500-52p
PLATFORM_MODULE := arm64_accton_as45xx_52p
include $(ONL)/packages/base/any/onlp/builds/platform/onlps.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(ONL)/make/pkg.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(ONL)/make/pkg.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!include $ONL_TEMPLATES/platform-config-platform.yml ARCH=arm64 VENDOR=accton BASENAME=arm64-accton-as4500-52p REVISION=r0
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---

######################################################################
#
# platform-config for AS4500-52P
#
######################################################################

arm64-accton-as4500-52p-r0:
flat_image_tree:
kernel:
<<: *arm64-kernel-5-15
dtb:
=: accton-as4500-52p.dtb
<<: *arm64-kernel-5-15-package
itb:
<<: *arm64-itb

loader:
device: /dev/mmcblk0
##partition: /dev/sda1
loadaddr: 0x220000000
nos_bootcmds: *mmc_bootcmds

setenv:
- bootargs: >-
console=ttyS0,115200
onl_platform=$onl_platform
arm-smmu.disable_bypass=n
maxcpus=8
pci=pcie_bus_perf
cpuidle.off=1

environment:
- device: /dev/mmcblk0boot0
env_offset: 0x001e0000
env_size: 0x00010000
sector_size: 0x00010000
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/python

from onl.platform.base import *
from onl.platform.accton import *

class OnlPlatform_arm64_accton_as4500_52p_r0(OnlPlatformAccton,
OnlPlatformPortConfig_48x1_4x10):
PLATFORM='arm64-accton-as4500-52p-r0'
MODEL="AS4500-52P"
SYS_OBJECT_ID=".4500.52.1"

def baseconfig(self):
self.insmod('optoe')
self.insmod('dps850')

# Insert platform drivers
for m in [ 'mux', 'cpld', 'psu' ]:
self.insmod("arm64-accton-as45xx-52p-%s" % m)

########### initialize I2C bus 1 ###########
self.new_i2c_devices(
[
# initialize CPLD
('pca9641_mux', 0x73, 0), # i2c-2
('as45xx_cpldm_mux', 0x76, 0), # i2c-3 ~ i2c-8
('as4500_cpld_m', 0x42, 0),
('as45xx_cpld_s', 0x62, 2),
('as45xx_psu1', 0x50, 6),
('dps850', 0x58, 6),
('as45xx_psu2', 0x51, 5),
('dps850', 0x59, 5),
('pca9546', 0x71, 7), # i2c-9 ~ i2c-12
('pca9546', 0x70, 8), # i2c-13 ~ i2c-16
('tmp175', 0x48, 10),
('tmp175', 0x49, 10),
('tmp175', 0x4b, 10),
('tmp175', 0x4c, 10),
('24c64', 0x54, 9)
]
)

# Insert platform drivers
for m in [ 'fan', 'sfp' ]:
self.insmod("arm64-accton-as45xx-52p-%s" % m)

# initialize SFP devices
for port in range(49, 53):
self.new_i2c_device('optoe2', 0x50, port-36)
subprocess.call('echo port%d > /sys/bus/i2c/devices/%d-0050/port_name' % (port, port-36), shell=True)

return True
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*arm64*accton*as4581*52pl.mk
onlpdump.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(ONL)/make/pkg.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(ONL)/make/pkg.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!include $ONL_TEMPLATES/platform-modules.yml ARCH=arm64 VENDOR=accton BASENAME=arm64-accton-as4581-52pl KERNELS="onl-kernel-5.15-lts-arm64-all:arm64"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
KERNELS := onl-kernel-5.15-lts-arm64-all:arm64
KMODULES := $(ONL)/packages/platforms/accton/arm64/as45xx-52p/src/modules/
VENDOR := accton
BASENAME := arm64-accton-as4581-52pl
ARCH := arm64
include $(ONL)/make/kmodule.mk
export CROSS_COMPILE=aarch64-linux-gnu-
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(ONL)/make/pkg.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!include $ONL_TEMPLATES/onlp-platform-any.yml PLATFORM=arm64-accton-as4581-52pl ARCH=arm64 TOOLCHAIN=aarch64-linux-gnu
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FILTER=src
include $(ONL)/make/subdirs.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PLATFORM := arm64-accton-as4581-52pl
PLATFORM_MODULE := arm64_accton_as45xx_52p
include $(ONL)/packages/base/any/onlp/builds/platform/libonlp-platform.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PLATFORM := arm64-accton-as4581-52pl
PLATFORM_MODULE := arm64_accton_as45xx_52p
include $(ONL)/packages/base/any/onlp/builds/platform/onlps.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(ONL)/make/pkg.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(ONL)/make/pkg.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!include $ONL_TEMPLATES/platform-config-platform.yml ARCH=arm64 VENDOR=accton BASENAME=arm64-accton-as4581-52pl REVISION=r0
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---

######################################################################
#
# platform-config for AS4581-52PL
#
######################################################################

arm64-accton-as4581-52pl-r0:
flat_image_tree:
kernel:
<<: *arm64-kernel-5-15
dtb:
=: accton-as4581-52pl.dtb
<<: *arm64-kernel-5-15-package
itb:
<<: *arm64-itb

loader:
device: /dev/sda
##partition: /dev/sda1
loadaddr: 0xa0000000
nos_bootcmds:
- scsi reset
- sf read 0x80d00000 0xd00000 0x100000
- fsl_mc lazyapply dpl 0x80d00000
- ext2load scsi 0:1 $onl_loadaddr $onl_itb
- "bootm $onl_loadaddr#$onl_platform"

setenv:
- bootargs: >-
console=ttyAMA0,115200
onl_platform=$onl_platform
arm-smmu.disable_bypass=n
maxcpus=8
pci=pcie_bus_perf

environment:
- device: /dev/mtd1
env_offset: 0x00000000
env_size: 0x00004000
sector_size: 0x00010000

network:
interfaces:
ma1:
name: eth0
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/python

from onl.platform.base import *
from onl.platform.accton import *

class OnlPlatform_arm64_accton_as4581_52pl_r0(OnlPlatformAccton,
OnlPlatformPortConfig_48x1_4x10):
PLATFORM='arm64-accton-as4581-52pl-r0'
MODEL="AS4581-52PL"
SYS_OBJECT_ID=".4581.52.1"

def baseconfig(self):
self.modprobe('i2c-imx')
self.modprobe('i2c-mux-pca954x')
self.insmod('optoe')
self.insmod('dps850')

# Insert platform drivers
for m in [ 'mux', 'cpld', 'psu', 'asc' ]:
self.insmod("arm64-accton-as45xx-52p-%s" % m)

########### initialize I2C bus 1 ###########
self.new_i2c_devices(
[
# initialize CPLD
('pca9641_mux', 0x73, 1), # i2c-8
('as45xx_cpldm_mux', 0x76, 1), # i2c-9 ~ i2c-14
('as4581_cpld_m', 0x61, 1),
('as45xx_cpld_s', 0x62, 8),
('as45xx_psu1', 0x50, 12),
('dps850', 0x58, 12),
('as45xx_psu2', 0x51, 11),
('dps850', 0x59, 11),
('pca9546', 0x71, 13), # i2c-15 ~ i2c-18
('pca9546', 0x70, 14), # i2c-19 ~ i2c-22
('tmp175', 0x48, 16),
('tmp175', 0x49, 16),
('tmp175', 0x4b, 16),
('tmp175', 0x4c, 16),
('24c64', 0x54, 15),

# initialize ASC
('pca9548', 0x70, 0), # i2c-23 ~ i2c-30
('as45xx_asc', 0x60, 26)
]
)

# Insert platform drivers
for m in [ 'fan', 'sfp' ]:
self.insmod("arm64-accton-as45xx-52p-%s" % m)

# initialize SFP devices
for port in range(49, 53):
self.new_i2c_device('optoe2', 0x50, port-30)
subprocess.call('echo port%d > /sys/bus/i2c/devices/%d-0050/port_name' % (port, port-30), shell=True)

return True
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
arm64_accton_as45xx_52p.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: arm64_accton_as45xx_52p
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
############################################################
#
#
#
############################################################
include $(ONL)/make/config.mk
MODULE := arm64_accton_as45xx_52p
AUTOMODULE := arm64_accton_as45xx_52p
include $(BUILDER)/definemodule.mk
Loading