-
Notifications
You must be signed in to change notification settings - Fork 60
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
[tn48m] Add new platform TN48M2-SWDEV #217
Changes from 3 commits
d6c100d
c846a24
4d43fc1
652c29e
c962cfd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ typedef enum plat_id { | |
PID_TN4810M_PVT, | ||
PID_TN48M2, | ||
PID_TN4810M_NONPVT, | ||
PID_TN48M2_SWDEV, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sort it (below There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Most of the IDs are fixed by HW, its not suitable to disarray them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Understood. It’d be nice, if you mentioned the (new) ID (number) in the commit message. |
||
PID_UNKNOWN, | ||
} plat_id_t; | ||
|
||
|
@@ -156,6 +157,7 @@ typedef enum plat_psu_id { | |
PLAT_PSU_ID_INVALID = 0, | ||
PLAT_PSU_ID_1, | ||
PLAT_PSU_ID_2, | ||
PLAT_PSU_ID_3, | ||
PLAT_PSU_ID_MAX | ||
} plat_psu_id_t; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,6 +173,12 @@ static plat_psu_t plat_tn48m2_psus[] = { | |
.power_status_path = "/sys/bus/i2c/devices/0-0041/psu2_powergood", | ||
.state = PLAT_PSU_STATE_PRESENT, | ||
}, | ||
[PLAT_PSU_ID_3] = { | ||
.name = "DCIN", | ||
.type = PLAT_PSU_TYPE_DC12, | ||
.power_status_path = "/sys/bus/i2c/devices/0-0041/dcin_powergood", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is representing a DC power connector, there is no physical DC PSU in the box. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Understood. Maybe mention that hardware detail in the commit message. |
||
.state = PLAT_PSU_STATE_PRESENT, | ||
}, | ||
}; | ||
|
||
static plat_psu_t* get_plat_psu() | ||
|
@@ -186,6 +192,7 @@ static plat_psu_t* get_plat_psu() | |
else if (gPlat_id == PID_TN4810M_NONPVT) | ||
return plat_tn4810m_nonpvt_psus; | ||
else | ||
/* tn48m2 and tn48m2-swdev shares the same psu configuration */ | ||
return plat_tn48m2_psus; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*arm64*delta*tn48m2*swdev*.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=delta BASENAME=arm64-delta-tn48m2-swdev 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/delta/arm64/tn48m/src/modules/ | ||
VENDOR := delta | ||
BASENAME := arm64-delta-tn48m2-swdev | ||
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-delta-tn48m2-swdev 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-delta-tn48m2-swdev | ||
PLATFORM_MODULE := arm64_delta_tn48m | ||
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-delta-tn48m2-swdev | ||
PLATFORM_MODULE := arm64_delta_tn48m | ||
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=delta BASENAME=arm64-delta-tn48m2-swdev REVISION=r0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
|
||
###################################################################### | ||
# | ||
# platform-config for TN48M2-SWDEV | ||
# | ||
###################################################################### | ||
|
||
arm64-delta-tn48m2-swdev-r0: | ||
flat_image_tree: | ||
kernel: | ||
<<: *arm64-kernel-5-15 | ||
dtb: | ||
=: delta-tn48m2-swdev.dtb | ||
<<: *arm64-kernel-5-15-package | ||
itb: | ||
<<: *arm64-itb | ||
|
||
loader: | ||
device: /dev/sda | ||
##partition: /dev/sda1 | ||
loadaddr: 0x10000000 | ||
nos_bootcmds: *ssd_bootcmds | ||
|
||
setenv: | ||
- bootargs: >- | ||
$console | ||
onl_platform=$onl_platform | ||
|
||
environment: | ||
- device: /dev/mtd1 | ||
env_offset: 0x00000000 | ||
env_size: 0x00010000 | ||
sector_size: 0x00010000 | ||
|
||
installer: | ||
- ONL-BOOT: | ||
=: 128MiB | ||
format: ext2 | ||
##format: raw | ||
- ONL-CONFIG: | ||
=: 128MiB | ||
format: ext4 | ||
- ONL-IMAGES: | ||
=: 1GiB | ||
format: ext4 | ||
- ONL-DATA: | ||
=: 100% | ||
format: ext4 | ||
|
||
network: | ||
interfaces: | ||
ma1: | ||
name: eth0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/python | ||
|
||
from onl.platform.base import * | ||
from onl.platform.delta import * | ||
|
||
class OnlPlatform_arm64_delta_tn48m2_swdev_r0(OnlPlatformDelta, | ||
OnlPlatformPortConfig_48x1_4x10): | ||
PLATFORM='arm64-delta-tn48m2-swdev-r0' | ||
MODEL="TN48M2-SWDEV" | ||
SYS_OBJECT_ID=".48.14" | ||
|
||
def baseconfig(self): | ||
# Insert platform drivers | ||
self.insmod("arm64-delta-tn48m-cpld.ko") | ||
self.insmod("arm64-delta-tn48m-led.ko") | ||
|
||
########### initialize I2C bus 1 ########### | ||
self.new_i2c_devices ( | ||
[ | ||
# FAN Controller | ||
('adt7473', 0x2e, 1), | ||
|
||
# Temperature devices | ||
('tmp1075', 0x4a, 1), | ||
('tmp1075', 0x4b, 1), | ||
] | ||
) | ||
|
||
# Insert Marvell prestera modules by only probing prestera_pci module | ||
# Suggested by Taras Chornyi | ||
self.modprobe('prestera_pci') | ||
|
||
# set up systemctl rules | ||
for swp in range(1, 53): | ||
cmd = "systemctl enable switchdev-online@swp%d" % swp | ||
subprocess.check_call(cmd, shell=True) | ||
|
||
return True |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,7 @@ arm64-nxp-ls1046ardb-r0 | |
arm64-delta-tx4810-r0 | ||
arm64-delta-tn4810m-r0 | ||
arm64-delta-tn48m2-r0 | ||
arm64-delta-tn48m2-swdev-r0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the only difference is the SPI flash size, please reconsider renaming the suffix from "swdev" to something like "spi64m". The fact that the board has extra SPI can be used for other things in the HW level, and it is not specific to switch-dev, which is in the software layer only. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree this platform name isn't quite distinctive, however the name was decided by our customer. |
||
arm64-delta-tn48m-r0 | ||
arm64-delta-tn48m-poe-r0 | ||
arm64-delta-tn48m-dn-r0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please factor out changing an existing platform into a separate commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, but it’d be great if you rephrased the commit message. Maybe something like: