From ea149f0f3df3b8f3313039dbad3174df54926d8b Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Fri, 26 Oct 2018 00:00:50 +0000 Subject: [PATCH] The 4610 54/30 variants now share the same DTS file. --- make/dtbs.mk | 26 +- make/kbuild.mk | 2 +- make/kmodule.mk | 2 +- .../platform-config/r0/builds/dtb/.gitignore | 1 + .../platform-config/r0/builds/dtb/Makefile | 11 +- .../r0/builds/dtb/arm-accton-as4610-54-r0.dts | 254 ------------------ .../r0/src/lib/arm-accton-as4610-30-r0.yml | 4 +- .../r0/builds/dtb/arm-accton-as4610-54-r0.dts | 254 ------------------ .../src/arm-accton-as4610.dts | 144 ++++++++++ 9 files changed, 178 insertions(+), 520 deletions(-) delete mode 100644 packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-30/platform-config/r0/builds/dtb/arm-accton-as4610-54-r0.dts delete mode 100644 packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-54/platform-config/r0/builds/dtb/arm-accton-as4610-54-r0.dts create mode 100644 packages/platforms/accton/armel/arm-accton-as4610/src/arm-accton-as4610.dts diff --git a/make/dtbs.mk b/make/dtbs.mk index 48753f1b..dd8b27d1 100644 --- a/make/dtbs.mk +++ b/make/dtbs.mk @@ -13,14 +13,30 @@ ifndef DTB_LIST DTB_LIST := $(patsubst %.dts,%.dtb,$(DTS_LIST)) endif -%.dtb: %.dts - $(ONL)/tools/dtc -I dts -O dtb -o $@ $< +ifndef DTC + ifdef KERNEL + DTC := $(shell $(ONLPM) --find-file $(KERNEL) dtc) + ifeq ($(DTC),) + $(error No device tree compiler.) + endif + else + DTC := $(ONL)/tools/dtc + endif +endif -.DEFAULT_GOAL := $(DTB_LIST) +%.dtb: %.dts + cpp -nostdinc -undef -x assembler-with-cpp $(foreach inc,$(INCLUDES),-I$(inc) ) $< > $(notdir $<).i + $(DTC) $(foreach inc,$(INCLUDES),-i$(inc) ) $(DTC_OPTIONS) -I dts -O dtb -o $@ $(notdir $<).i + rm $(notdir $<).i + +.DEFAULT_GOAL := dtbs + +dtbs: $(DTB_LIST) + echo $(DTB_LIST) $(VPATH) + $(MAKE) setup-clean $(DTB_LIST): setup clean:: - rm -rf *.dtb - setup:: +setup-clean:: diff --git a/make/kbuild.mk b/make/kbuild.mk index 12052db8..8be2961b 100644 --- a/make/kbuild.mk +++ b/make/kbuild.mk @@ -174,7 +174,7 @@ endif MODSYNCLIST_DEFAULT := .config Module.symvers Makefile include scripts drivers \ arch/x86/include arch/x86/Makefile \ arch/powerpc/include arch/powerpc/Makefile arch/powerpc/lib arch/powerpc/boot/dts \ - arch/arm/include arch/arm/Makefile arch/arm/lib arch/arm/boot/dts + arch/arm/include arch/arm/Makefile arch/arm/lib arch/arm/boot/dts arch/arm/kernel MODSYNCLIST := $(MODSYNCLIST_DEFAULT) $(MODSYNCLIST_EXTRA) $(K_MODSYNCLIST) diff --git a/make/kmodule.mk b/make/kmodule.mk index aa84a07c..e87225a8 100644 --- a/make/kmodule.mk +++ b/make/kmodule.mk @@ -26,4 +26,4 @@ endif modules: rm -rf lib - ARCH=$(ARCH) $(ONL)/tools/scripts/kmodbuild.sh "$(KERNELS)" "$(KMODULES)" "$(SUBDIR)" + ARCH=$(ARCH) $(ONL)/tools/scripts/kmodbuild.sh "$(KERNELS)" "$(KMODULES)" "$(SUBDIR)" "$(KINCLUDES)" diff --git a/packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-30/platform-config/r0/builds/dtb/.gitignore b/packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-30/platform-config/r0/builds/dtb/.gitignore index 7ac7a04f..f9450b8b 100644 --- a/packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-30/platform-config/r0/builds/dtb/.gitignore +++ b/packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-30/platform-config/r0/builds/dtb/.gitignore @@ -1,2 +1,3 @@ *.dtb dts +include diff --git a/packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-30/platform-config/r0/builds/dtb/Makefile b/packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-30/platform-config/r0/builds/dtb/Makefile index 2956bc6e..85642cb1 100644 --- a/packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-30/platform-config/r0/builds/dtb/Makefile +++ b/packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-30/platform-config/r0/builds/dtb/Makefile @@ -1,10 +1,15 @@ +INCLUDES=include . +KERNEL := onl-kernel-4.14-lts-arm-iproc-all:armel +DTS_LIST := arm-accton-as4610.dts +VPATH := ../../../../../src include $(ONL)/make/dtbs.mk # # The 4610 DTS relies on the common arm devices tree includes. These are linked here from the kernel package. # setup:: - onlpm --link-dir onl-kernel-3.2-lts-arm-iproc-all:armel /usr/share/onl/packages/armel/onl-kernel-3.2-lts-arm-iproc-all/mbuilds/arch/arm/boot/dts dts + onlpm --link-dir onl-kernel-4.14-lts-arm-iproc-all:armel /usr/share/onl/packages/armel/onl-kernel-4.14-lts-arm-iproc-all/mbuilds/arch/arm/boot/dts dts + onlpm --link-dir onl-kernel-4.14-lts-arm-iproc-all:armel /usr/share/onl/packages/armel/onl-kernel-4.14-lts-arm-iproc-all/mbuilds/include include -clean:: - rm -rf fsl +setup-clean:: + #rm -rf dts include diff --git a/packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-30/platform-config/r0/builds/dtb/arm-accton-as4610-54-r0.dts b/packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-30/platform-config/r0/builds/dtb/arm-accton-as4610-54-r0.dts deleted file mode 100644 index 0e7a33c0..00000000 --- a/packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-30/platform-config/r0/builds/dtb/arm-accton-as4610-54-r0.dts +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Accton AS4610 54 Device Tree Source - * - * Copyright 2015, Cumulus Networks, Inc. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - */ -/dts-v1/; -/include/ "dts/helix4.dtsi" - -/ { - model = "accton,as4610_54"; - compatible = "accton,as4610_54"; - - aliases { - serial0 = &uart0; - i2c-controller0 = &i2c0; - i2c-controller1 = &i2c1; - }; - - memory { - reg = <0x61000000 0x7f000000>; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "arm,cortex-a9"; - next-level-cache = <&L2>; - reg = <0x00>; - }; - cpu@1 { - device_type = "cpu"; - compatible = "arm,cortex-a9"; - next-level-cache = <&L2>; - reg = <0x01>; - }; - }; - - localbus@1c000000 { - #address-cells = <0x2>; - #size-cells = <0x1>; - /* NAND Flash */ - ranges = < - 0x0 0x0 0x0 0x1c000000 0x00120000 - 0x1 0x0 0x0 0x1c120000 0x00040000 - >; - - flash@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x0 0x0 0x02000000>; - byteswap; - - partition@0 { - /* uboot */ - reg = <0x00000000 0x00100000>; - label = "uboot"; - }; - partition@1 { - /* uboot-env */ - reg = <0x00100000 0x00100000>; - label = "uboot-env"; - env_size = <0x2000>; - }; - partition@2 { - /* board_eeprom */ - reg = <0x00200000 0x00100000>; - label = "board_eeprom"; - }; - partition@3 { - /* shmoo */ - reg = <0x00300000 0x00100000>; - label = "shmoo"; - }; - partition@4 { - /* onie */ - reg = <0x00400000 0x00800000>; - label = "onie"; - }; - partition@5 { - /* open */ - reg = <0x00c00000 0x03c00000>; - label = "open"; - }; - partition@6 { - /* open2 */ - reg = <0x04800000 0x7d000000>; - label = "open2"; - }; - partition@7 { - /* diag */ - reg = <0xfec00000 0x01000000>; - label = "diag"; - }; - }; - }; - - i2c0: i2c@18038000 { - compatible = "iproc-smb"; - reg = <0x18038000 0x1000>; - #address-cells = <1>; - #size-cells = <0>; - interrupts = < 127 >; - clock-frequency = <400000>; - cpld@1,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "accton,as4610_54_cpld"; - label = "cpld"; - reg = <0x30>; - }; - }; - - i2c1: i2c@1803b000 { - compatible = "iproc-smb"; - reg = <0x1803b000 0x1000>; - #address-cells = <1>; - #size-cells = <0>; - interrupts = < 128 >; - clock-frequency = <100000>; - mux@70 { - compatible = "ti,pca9548"; - reg = <0x70>; - #address-cells = <1>; - #size-cells = <0>; - deselect-on-exit; - - // SFP+ 1 - i2c@0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - sfp_eeprom@50 { - compatible = "at,as4610_sfp1"; - reg = <0x50>; - label = "port49"; - }; - }; - - // SFP+ 2 - i2c@1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - sfp_eeprom@50 { - compatible = "accton,as4610_sfp2"; - reg = <0x50>; - label = "port50"; - }; - }; - - // SFP+ 3 - i2c@2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - sfp_eeprom@50 { - compatible = "accton,as4610_sfp3"; - reg = <0x50>; - label = "port51"; - }; - }; - - // SFP+ 4 - i2c@3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - sfp_eeprom@50 { - compatible = "accton,as4610_sfp4"; - reg = <0x50>; - label = "port52"; - }; - }; - - // QSFP+ STK1 - i2c@4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - sfp_eeprom@50 { - compatible = "accton,as4610_sfp5"; - reg = <0x50>; - }; - }; - - // QSFP+ STK2 - i2c@5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - sfp_eeprom@50 { - compatible = "accton,as4610_sfp6"; - reg = <0x50>; - }; - }; - - // PSU EEPROM - i2c@6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - psu1_eeprom@50 { - compatible = "accton,as4610_psu1"; - reg = <0x50>; - }; - psu1_pmbus@58 { - compatible = "3y-power,ym1921"; - reg = <0x58>; - }; - psu2_eeprom@51 { - compatible = "accton,as4610_psu2"; - reg = <0x51>; - }; - psu2_pmbus@59 { - compatible = "3y-power,ym1921"; - reg = <0x59>; - }; - }; - - i2c@7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - - temp@48 { - compatible = "nxp,lm77"; - reg = <0x48>; - }; - - rtc@68 { - /* Actually M41T11 */ - compatible = "dallas,ds1307"; - reg = <0x68>; - }; - - board_eeprom@50 { - compatible = "at,24c04"; - reg = <0x50>; - label = "board_eeprom"; - }; - }; - }; - }; -}; diff --git a/packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-30/platform-config/r0/src/lib/arm-accton-as4610-30-r0.yml b/packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-30/platform-config/r0/src/lib/arm-accton-as4610-30-r0.yml index 937774e8..aa211301 100644 --- a/packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-30/platform-config/r0/src/lib/arm-accton-as4610-30-r0.yml +++ b/packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-30/platform-config/r0/src/lib/arm-accton-as4610-30-r0.yml @@ -9,9 +9,9 @@ arm-accton-as4610-30-r0: flat_image_tree: kernel: - <<: *arm-iproc-kernel + <<: *arm-iproc-4-14-kernel dtb: - =: arm-accton-as4610-54-r0.dtb + =: arm-accton-as4610.dtb package: onl-platform-build-arm-accton-as4610-30-r0:armel itb: diff --git a/packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-54/platform-config/r0/builds/dtb/arm-accton-as4610-54-r0.dts b/packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-54/platform-config/r0/builds/dtb/arm-accton-as4610-54-r0.dts deleted file mode 100644 index 0e7a33c0..00000000 --- a/packages/platforms/accton/armel/arm-accton-as4610/arm-accton-as4610-54/platform-config/r0/builds/dtb/arm-accton-as4610-54-r0.dts +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Accton AS4610 54 Device Tree Source - * - * Copyright 2015, Cumulus Networks, Inc. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - */ -/dts-v1/; -/include/ "dts/helix4.dtsi" - -/ { - model = "accton,as4610_54"; - compatible = "accton,as4610_54"; - - aliases { - serial0 = &uart0; - i2c-controller0 = &i2c0; - i2c-controller1 = &i2c1; - }; - - memory { - reg = <0x61000000 0x7f000000>; - }; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "arm,cortex-a9"; - next-level-cache = <&L2>; - reg = <0x00>; - }; - cpu@1 { - device_type = "cpu"; - compatible = "arm,cortex-a9"; - next-level-cache = <&L2>; - reg = <0x01>; - }; - }; - - localbus@1c000000 { - #address-cells = <0x2>; - #size-cells = <0x1>; - /* NAND Flash */ - ranges = < - 0x0 0x0 0x0 0x1c000000 0x00120000 - 0x1 0x0 0x0 0x1c120000 0x00040000 - >; - - flash@0,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x0 0x0 0x02000000>; - byteswap; - - partition@0 { - /* uboot */ - reg = <0x00000000 0x00100000>; - label = "uboot"; - }; - partition@1 { - /* uboot-env */ - reg = <0x00100000 0x00100000>; - label = "uboot-env"; - env_size = <0x2000>; - }; - partition@2 { - /* board_eeprom */ - reg = <0x00200000 0x00100000>; - label = "board_eeprom"; - }; - partition@3 { - /* shmoo */ - reg = <0x00300000 0x00100000>; - label = "shmoo"; - }; - partition@4 { - /* onie */ - reg = <0x00400000 0x00800000>; - label = "onie"; - }; - partition@5 { - /* open */ - reg = <0x00c00000 0x03c00000>; - label = "open"; - }; - partition@6 { - /* open2 */ - reg = <0x04800000 0x7d000000>; - label = "open2"; - }; - partition@7 { - /* diag */ - reg = <0xfec00000 0x01000000>; - label = "diag"; - }; - }; - }; - - i2c0: i2c@18038000 { - compatible = "iproc-smb"; - reg = <0x18038000 0x1000>; - #address-cells = <1>; - #size-cells = <0>; - interrupts = < 127 >; - clock-frequency = <400000>; - cpld@1,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "accton,as4610_54_cpld"; - label = "cpld"; - reg = <0x30>; - }; - }; - - i2c1: i2c@1803b000 { - compatible = "iproc-smb"; - reg = <0x1803b000 0x1000>; - #address-cells = <1>; - #size-cells = <0>; - interrupts = < 128 >; - clock-frequency = <100000>; - mux@70 { - compatible = "ti,pca9548"; - reg = <0x70>; - #address-cells = <1>; - #size-cells = <0>; - deselect-on-exit; - - // SFP+ 1 - i2c@0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - sfp_eeprom@50 { - compatible = "at,as4610_sfp1"; - reg = <0x50>; - label = "port49"; - }; - }; - - // SFP+ 2 - i2c@1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - sfp_eeprom@50 { - compatible = "accton,as4610_sfp2"; - reg = <0x50>; - label = "port50"; - }; - }; - - // SFP+ 3 - i2c@2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - sfp_eeprom@50 { - compatible = "accton,as4610_sfp3"; - reg = <0x50>; - label = "port51"; - }; - }; - - // SFP+ 4 - i2c@3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - sfp_eeprom@50 { - compatible = "accton,as4610_sfp4"; - reg = <0x50>; - label = "port52"; - }; - }; - - // QSFP+ STK1 - i2c@4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - sfp_eeprom@50 { - compatible = "accton,as4610_sfp5"; - reg = <0x50>; - }; - }; - - // QSFP+ STK2 - i2c@5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - sfp_eeprom@50 { - compatible = "accton,as4610_sfp6"; - reg = <0x50>; - }; - }; - - // PSU EEPROM - i2c@6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - psu1_eeprom@50 { - compatible = "accton,as4610_psu1"; - reg = <0x50>; - }; - psu1_pmbus@58 { - compatible = "3y-power,ym1921"; - reg = <0x58>; - }; - psu2_eeprom@51 { - compatible = "accton,as4610_psu2"; - reg = <0x51>; - }; - psu2_pmbus@59 { - compatible = "3y-power,ym1921"; - reg = <0x59>; - }; - }; - - i2c@7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - - temp@48 { - compatible = "nxp,lm77"; - reg = <0x48>; - }; - - rtc@68 { - /* Actually M41T11 */ - compatible = "dallas,ds1307"; - reg = <0x68>; - }; - - board_eeprom@50 { - compatible = "at,24c04"; - reg = <0x50>; - label = "board_eeprom"; - }; - }; - }; - }; -}; diff --git a/packages/platforms/accton/armel/arm-accton-as4610/src/arm-accton-as4610.dts b/packages/platforms/accton/armel/arm-accton-as4610/src/arm-accton-as4610.dts new file mode 100644 index 00000000..badba80d --- /dev/null +++ b/packages/platforms/accton/armel/arm-accton-as4610/src/arm-accton-as4610.dts @@ -0,0 +1,144 @@ +/* + * Accton AS4610 54 Device Tree Source + * + * Copyright 2015, Cumulus Networks, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + */ +/dts-v1/; +#include "dts/bcm-helix4.dtsi" + +/ { + model = "accton,as4610_54"; + compatible = "accton,as4610_54","brcm,helix4"; + + aliases { + serial0 = &uart1; + serial1 = &uart2; + ethernet0 = &gmac0; + i2c-controller0 = &i2c0; + i2c-controller1 = &i2c1; + }; + + memory { + reg = <0x61000000 0x7f000000>; + }; + + localbus@1c000000 { + #address-cells = <0x2>; + #size-cells = <0x1>; + /* NAND Flash */ + ranges = < + 0x0 0x0 0x0 0x1c000000 0x00120000 + 0x1 0x0 0x0 0x1c120000 0x00040000 + >; + + flash@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x0 0x0 0x02000000>; + byteswap; + + partition@0 { + /* uboot */ + reg = <0x00000000 0x00100000>; + label = "uboot"; + }; + partition@1 { + /* uboot-env */ + reg = <0x00100000 0x00100000>; + label = "uboot-env"; + env_size = <0x2000>; + }; + partition@2 { + /* board_eeprom */ + reg = <0x00200000 0x00100000>; + label = "board_eeprom"; + }; + partition@3 { + /* shmoo */ + reg = <0x00300000 0x00100000>; + label = "shmoo"; + }; + partition@4 { + /* onie */ + reg = <0x00400000 0x00800000>; + label = "onie"; + }; + partition@5 { + /* open */ + reg = <0x00c00000 0x03c00000>; + label = "open"; + }; + partition@6 { + /* open2 */ + reg = <0x04800000 0x7d000000>; + label = "open2"; + }; + partition@7 { + /* diag */ + reg = <0xfec00000 0x01000000>; + label = "diag"; + }; + }; + }; +}; + +&uart1 { + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +&gmac0 { + status = "okay"; + phy-mode = "sgmii"; /* "gmii-id", "gmii-rxid", "sgmii" */ +}; + +&ehci0 { + status = "okay"; +}; + +&gpio_cca { + status = "disabled"; +}; + +&usbphy0 { + status = "okay"; +}; + +&usbd { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + clock-frequency = <400000>; +}; + +&i2c1 { + status = "okay"; +}; + +&hwrng { + status = "okay"; +}; + +&iproc_wdt { + status = "okay"; +}; + +&dmac0 { + status = "okay"; +}; + +&iproc_cmicd { + status = "okay"; +};