From d75e75306301852a848824cf268d8b58eda28a8a Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 29 Aug 2020 01:13:56 +0100 Subject: [PATCH 01/11] oxnas: kd20: revert accedintally commited change Changing the factory image of KD20 was used during testing and wasn't intended to be included in the commit fixing a SATA bug on oxnas. Revert that part of the commit. Fixes: 5793112f75 ("oxnas: reduce size of ATA DMA descriptor space") Signed-off-by: Daniel Golle --- target/linux/oxnas/image/ox820.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/oxnas/image/ox820.mk b/target/linux/oxnas/image/ox820.mk index a52e09786b..f00cfe8608 100644 --- a/target/linux/oxnas/image/ox820.mk +++ b/target/linux/oxnas/image/ox820.mk @@ -68,6 +68,10 @@ define Device/shuttle_kd20 DEVICE_VENDOR := Shuttle DEVICE_MODEL := KD20 SUPPORTED_DEVICES += kd20 + KERNEL_INITRAMFS_PREFIX = $$(IMAGE_PREFIX)-factory + KERNEL_INITRAMFS_SUFFIX := .tar.gz + KERNEL_INITRAMFS = kernel-bin | append-dtb | uImage none | omninas-factory | \ + encrypt-3des sohmuntitnlaes DEVICE_PACKAGES := kmod-usb2-oxnas kmod-usb3 kmod-usb-ledtrig-usbport \ kmod-i2c-gpio kmod-rtc-pcf8563 kmod-gpio-beeper kmod-hwmon-drivetemp \ kmod-hwmon-gpiofan kmod-ata-oxnas-sata kmod-md-mod kmod-md-raid0 \ From 2c3f16d70e32d7b5eb62096097c4343c5409afe3 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Wed, 12 Aug 2020 01:21:13 +0200 Subject: [PATCH 02/11] apm821xx: WNDR4700: enumerate PCIe in device-tree This patch adds the pcie-switch and bridge configuration of the WNDR4700. This allows to get rid of the legacy firmware monikers and drop the usbport LED declaration. Signed-off-by: Christian Lamparter --- .../apm821xx/base-files/etc/board.d/01_leds | 3 - .../etc/hotplug.d/firmware/10-ath9k-eeprom | 42 ++++----- .../linux/apm821xx/dts/netgear-wndr4700.dts | 94 +++++++++++++++++++ .../arch/powerpc/platforms/44x/wndr4700.c | 19 ---- 4 files changed, 115 insertions(+), 43 deletions(-) diff --git a/target/linux/apm821xx/base-files/etc/board.d/01_leds b/target/linux/apm821xx/base-files/etc/board.d/01_leds index dd529b528d..57598c0ca9 100755 --- a/target/linux/apm821xx/base-files/etc/board.d/01_leds +++ b/target/linux/apm821xx/base-files/etc/board.d/01_leds @@ -42,9 +42,6 @@ netgear,wndap660) netgear,wndr4700) ucidef_set_led_switch "wan_green" "WAN (green)" "wndr4700:green:wan" "switch0" "0x20" ucidef_set_led_netdev "wan_yellow" "WAN (yellow)" "wndr4700:yellow:wan" "eth0.2" "tx rx" - ucidef_set_led_usbport "usb3" "USB3" "wndr4700:blue:usb" "usb2-port1" "usb2-port2" "usb3-port1" "usb3-port2" - ucidef_set_led_wlan "wlan2g" "WLAN2G" "wndr4700:blue:wlan" "phy0tpt" - ucidef_set_led_wlan "wlan5g" "WLAN5G" "wndr4700:blue:wlan" "phy1tpt" ;; *) diff --git a/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index ee58901d18..dcdcf4dc45 100644 --- a/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -7,27 +7,9 @@ board=$(board_name) case "$FIRMWARE" in -"pci_wmac0.eeprom") - case $board in - netgear,wndr4700) - . /lib/upgrade/nand.sh - - if [ -n "$(nand_find_volume ubi0 caldata)" ]; then - caldata_extract_ubi "caldata" 0x5000 0x1000 - else - caldata_extract "wifi_data" 0x5000 0x1000 - ath9k_patch_mac $(mtd_get_mac_binary wifi_data 0xc) - fi - ;; - *) - caldata_die "board $board is not supported yet" - ;; - esac - ;; - -"pci_wmac1.eeprom") - case $board in - netgear,wndr4700) +"ath9k-eeprom-pci-0000:43:00.0.bin") + case $board in + netgear,wndr4700) . /lib/upgrade/nand.sh if [ -n "$(nand_find_volume ubi0 caldata)" ]; then @@ -42,4 +24,22 @@ case "$FIRMWARE" in ;; esac ;; + +"ath9k-eeprom-pci-0000:44:00.0.bin") + case $board in + netgear,wndr4700) + . /lib/upgrade/nand.sh + + if [ -n "$(nand_find_volume ubi0 caldata)" ]; then + caldata_extract_ubi "caldata" 0x5000 0x1000 + else + caldata_extract "wifi_data" 0x5000 0x1000 + ath9k_patch_mac $(mtd_get_mac_binary wifi_data 0xc) + fi + ;; + *) + caldata_die "board $board is not supported yet" + ;; + esac + ;; esac diff --git a/target/linux/apm821xx/dts/netgear-wndr4700.dts b/target/linux/apm821xx/dts/netgear-wndr4700.dts index 8972d2b030..a1c23896a1 100644 --- a/target/linux/apm821xx/dts/netgear-wndr4700.dts +++ b/target/linux/apm821xx/dts/netgear-wndr4700.dts @@ -381,6 +381,9 @@ usb-blue { label = "wndr4700:blue:usb"; gpios = <&GPIO0 10 GPIO_ACTIVE_HIGH>; + trigger-sources = <&usb2_port 1>, <&usb2_port 2>, + <&usb3_port 1>, <&usb3_port 2>; + linux,default-trigger = "usbport"; }; logo-white { @@ -412,12 +415,103 @@ wlan-blue { label = "wndr4700:blue:wlan"; gpios = <&GPIO0 18 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; }; }; }; &PCIE0 { status = "okay"; + + /* + * relevant lspci topology: + * + * -+-[0000:40]---00.0-[41-7f]----00.0-[42-45]--+-02.0-[43]----00.0 + * +-03.0-[44]----00.0 + * \-04.0-[45]----00.0 + * + */ + + bridge@64,0 { + reg = <0x00400000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + bridge@65,0 { + /* IDT PES4T4 PCI Express Switch */ + compatible = "pci111d,803a"; + reg = <0x00410000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + bridge@66,2 { + compatible = "pci111d,803a"; + reg = <0x00421000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi0: wifi@67,0 { + /* Atheros AR9380 5GHz */ + compatible = "pci168c,0030"; + reg = <0x00430000 0 0 0 0>; + qca,no-eeprom; + /* wifi CAL & MAC is stored in nvram */ + + /* + * Because this was such a pain. + * Here's the full device path: + * pci0000:40/0000:40:00.0/0000:41:00.0/0000:42:02.0/0000:43:00.0 + */ + }; + }; + + bridge@66,3 { + compatible = "pci111d,803a"; + reg = <0x00421800 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi1: wifi@68,0 { + /* Atheros AR9381 2.4GHz */ + compatible = "pci168c,0033"; + reg = <0x00440000 0 0 0 0>; + qca,no-eeprom; + /* wifi CAL & MAC is stored in nvram */ + }; + }; + + bridge@66,4 { + compatible = "pci111d,803a"; + reg = <0x00422000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + usb1: usb@69,0 { + /* Renesas uPD720202 */ + compatible = "pci1912,0015"; + reg = <0x00450000 0 0 0 0>; + + #address-cells = <1>; + #size-cells = <0>; + + usb2_port: port@1 { + reg = <1>; + #trigger-source-cells = <1>; + }; + + usb3_port: port@2 { + reg = <2>; + #trigger-source-cells = <1>; + }; + }; + }; + }; + }; }; &MSI { diff --git a/target/linux/apm821xx/files/arch/powerpc/platforms/44x/wndr4700.c b/target/linux/apm821xx/files/arch/powerpc/platforms/44x/wndr4700.c index f50f43f3df..ff6137e2a4 100644 --- a/target/linux/apm821xx/files/arch/powerpc/platforms/44x/wndr4700.c +++ b/target/linux/apm821xx/files/arch/powerpc/platforms/44x/wndr4700.c @@ -73,27 +73,8 @@ define_machine(wndr4700) { .calibrate_decr = generic_calibrate_decr, }; -static struct ath9k_platform_data ar9380_wmac0_data = { - .led_pin = -1, - .eeprom_name = "pci_wmac1.eeprom", -}; -static struct ath9k_platform_data ar9580_wmac1_data = { - .led_pin = -1, - .eeprom_name = "pci_wmac0.eeprom", -}; - static int __init wndr4700_ath9k_eeprom_load(void) { - struct pci_dev *dev; - - dev = pci_get_device(PCI_VENDOR_ID_ATHEROS, 0x0030, NULL); - if (dev) - dev->dev.platform_data = &ar9380_wmac0_data; - - dev = pci_get_device(PCI_VENDOR_ID_ATHEROS, 0x0033, NULL); - if (dev) - dev->dev.platform_data = &ar9580_wmac1_data; - return 0; } machine_device_initcall(wndr4700, wndr4700_ath9k_eeprom_load); From 0facedb515a3be864366463de1c7d28212a4ac1f Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Wed, 12 Aug 2020 18:05:06 +0200 Subject: [PATCH 03/11] apm821xx: WNDAP6x0: enumerate PCIe in device-tree This patch adds the pcie-switch and bridge configuration of the WNDAP620 and WNDAP660. Signed-off-by: Christian Lamparter --- .../linux/apm821xx/dts/netgear-wndap620.dts | 21 ++++++++ .../linux/apm821xx/dts/netgear-wndap660.dts | 54 +++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/target/linux/apm821xx/dts/netgear-wndap620.dts b/target/linux/apm821xx/dts/netgear-wndap620.dts index 87b4e51a81..b01c2a5d62 100644 --- a/target/linux/apm821xx/dts/netgear-wndap620.dts +++ b/target/linux/apm821xx/dts/netgear-wndap620.dts @@ -26,3 +26,24 @@ gpios = <&GPIO0 10 GPIO_ACTIVE_HIGH>; }; }; + +&PCIE0 { + /* + * relevant lspci topology: + * + * -+-[0000:40]---00.0-[41-7f]----00.0 + */ + + bridge@64,0 { + reg = <0x00400000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi0: wifi@65,0 { + /* Atheros AR9380 5GHz */ + compatible = "pci168c,0030"; + reg = <0x00410000 0 0 0 0>; + }; + }; +}; diff --git a/target/linux/apm821xx/dts/netgear-wndap660.dts b/target/linux/apm821xx/dts/netgear-wndap660.dts index 3e5daac835..5d8fd50b6a 100644 --- a/target/linux/apm821xx/dts/netgear-wndap660.dts +++ b/target/linux/apm821xx/dts/netgear-wndap660.dts @@ -36,3 +36,57 @@ gpios = <&GPIO0 10 GPIO_ACTIVE_HIGH>; }; }; + +&PCIE0 { + /* + * relevant lspci topology: + * + * -+-[0000:40]---00.0-[41-7f]----00.0-[42-45]--+-02.0-[43]----00.0 + * +-03.0-[44]----00.0 + * + */ + + bridge@64,0 { + reg = <0x00400000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + bridge@65,0 { + /* IDT PES3T3 PCI Express Switch */ + compatible = "pci111d,8039"; + reg = <0x00410000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + bridge@66,2 { + compatible = "pci111d,8039"; + reg = <0x00421000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi0: wifi@67,0 { + /* Atheros AR9380 2.4/5GHz */ + compatible = "pci168c,0030"; + reg = <0x00430000 0 0 0 0>; + }; + }; + + bridge@66,3 { + compatible = "pci111d,8039"; + reg = <0x00421800 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi1: wifi@68,0 { + /* Atheros AR9380 2.4/5GHz */ + compatible = "pci168c,0030"; + reg = <0x00440000 0 0 0 0>; + }; + }; + }; + }; +}; From 90909ef4ba85084d032b30f59c0bc72e45aaf60e Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Wed, 12 Aug 2020 18:13:47 +0200 Subject: [PATCH 04/11] apm821xx: DTB: fix warnings related to sata-port warnings This patch silences the following warnings: >netgear-wndr4700.dts:168.3-13:Warning (reg_format): /plb/sata@bffd1800/sata-port@0:reg:property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1) >netgear-wndr4700.dts:167.26-170.4: Warning (avoid_default_addr_size):/plb/sata@bffd1800/sata-port@0: Relying on default #address-cells value >netgear-wndr4700.dts:167.26-170.4: Warning (avoid_default_addr_size):/plb/sata@bffd1800/sata-port@0: Relying on default #size-cells value Signed-off-by: Christian Lamparter --- target/linux/apm821xx/dts/apm82181.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/apm821xx/dts/apm82181.dtsi b/target/linux/apm821xx/dts/apm82181.dtsi index 65032ba217..d17e269a55 100644 --- a/target/linux/apm821xx/dts/apm82181.dtsi +++ b/target/linux/apm821xx/dts/apm82181.dtsi @@ -407,6 +407,8 @@ dmas = <&AHBDMA0 0 0 1>; dma-names = "sata-dma"; status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; }; SATA1: sata@bffd1800 { @@ -417,6 +419,8 @@ dmas = <&AHBDMA0 1 0 2>; dma-names = "sata-dma"; status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; }; MSI: ppc4xx-msi@c10000000 { From b15420fc6c55bccb4c773e5c095a07eb30459bcb Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Wed, 12 Aug 2020 18:23:10 +0200 Subject: [PATCH 05/11] apm821xx: add missing cells-values for IIC1 These are copied over from the IIC0. Signed-off-by: Christian Lamparter --- target/linux/apm821xx/dts/apm82181.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/apm821xx/dts/apm82181.dtsi b/target/linux/apm821xx/dts/apm82181.dtsi index d17e269a55..27ec5c3ac9 100644 --- a/target/linux/apm821xx/dts/apm82181.dtsi +++ b/target/linux/apm821xx/dts/apm82181.dtsi @@ -306,6 +306,8 @@ reg = <0xef600800 0x00000014>; interrupt-parent = <&UIC0>; interrupts = <0x03 IRQ_TYPE_LEVEL_HIGH>; + #address-cells = <1>; + #size-cells = <0>; status = "disabled"; }; From 9153955095f01a7ac5f2659a671f0229cbad3507 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Wed, 12 Aug 2020 18:26:43 +0200 Subject: [PATCH 06/11] apm821xx: MR24: enumerate PCIe in device-tree This patch adds the pcie-switch and bridge configuration for the Meraki MR24. Signed-off-by: Christian Lamparter --- target/linux/apm821xx/dts/meraki-mr24.dts | 51 +++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/target/linux/apm821xx/dts/meraki-mr24.dts b/target/linux/apm821xx/dts/meraki-mr24.dts index 8fdef7c171..97a69e71d1 100644 --- a/target/linux/apm821xx/dts/meraki-mr24.dts +++ b/target/linux/apm821xx/dts/meraki-mr24.dts @@ -182,6 +182,57 @@ &PCIE0 { status = "okay"; + /* + * relevant lspci topology: + * + * -+-[0000:40]---00.0-[41-7f]----00.0-[42-45]--+-02.0-[43]----00.0 + * +-03.0-[44]----00.0 + * + */ + + bridge@64,0 { + reg = <0x00400000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + bridge@65,0 { + /* IDT PES3T3 PCI Express Switch */ + compatible = "pci111d,8039"; + reg = <0x00410000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + bridge@66,2 { + compatible = "pci111d,8039"; + reg = <0x00421000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi0: wifi@67,0 { + /* Atheros AR9380 2.4GHz */ + compatible = "pci168c,0030"; + reg = <0x00430000 0 0 0 0>; + }; + }; + + bridge@66,3 { + compatible = "pci111d,8039"; + reg = <0x00421800 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi1: wifi@68,0 { + /* Atheros AR9380 5GHz */ + compatible = "pci168c,0030"; + reg = <0x00440000 0 0 0 0>; + }; + }; + }; + }; }; &MSI { From 1640e71e8e1b3293a545e26ea5b17ddcbdb622e1 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Wed, 12 Aug 2020 19:52:08 +0200 Subject: [PATCH 07/11] apm821xx: WNDR4700: delete wndr4700 board file Thanks to the PCIE OF enumeration patch, this is technically no longer needed. Signed-off-by: Christian Lamparter --- target/linux/apm821xx/config-5.4 | 1 - .../linux/apm821xx/dts/netgear-wndr4700.dts | 2 +- .../arch/powerpc/platforms/44x/wndr4700.c | 80 ------------------- target/linux/apm821xx/nand/config-default | 1 - .../202-add-netgear-wndr4700-support.patch | 32 -------- 5 files changed, 1 insertion(+), 115 deletions(-) delete mode 100644 target/linux/apm821xx/files/arch/powerpc/platforms/44x/wndr4700.c delete mode 100644 target/linux/apm821xx/patches-5.4/202-add-netgear-wndr4700-support.patch diff --git a/target/linux/apm821xx/config-5.4 b/target/linux/apm821xx/config-5.4 index d54eb95d14..0f59e9f8ff 100644 --- a/target/linux/apm821xx/config-5.4 +++ b/target/linux/apm821xx/config-5.4 @@ -334,7 +334,6 @@ CONFIG_VDSO32=y # CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set # CONFIG_WARP is not set CONFIG_WATCHDOG_CORE=y -# CONFIG_WNDR4700 is not set # CONFIG_XILINX_SYSACE is not set # CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set CONFIG_XZ_DEC_BCJ=y diff --git a/target/linux/apm821xx/dts/netgear-wndr4700.dts b/target/linux/apm821xx/dts/netgear-wndr4700.dts index a1c23896a1..039c68f30f 100644 --- a/target/linux/apm821xx/dts/netgear-wndr4700.dts +++ b/target/linux/apm821xx/dts/netgear-wndr4700.dts @@ -15,7 +15,7 @@ / { model = "Netgear WNDR4700/WNDR4720 Series"; - compatible = "netgear,wndr4700"; + compatible = "netgear,wndr4700", "apm,bluestone"; aliases { serial0 = &UART0; diff --git a/target/linux/apm821xx/files/arch/powerpc/platforms/44x/wndr4700.c b/target/linux/apm821xx/files/arch/powerpc/platforms/44x/wndr4700.c deleted file mode 100644 index ff6137e2a4..0000000000 --- a/target/linux/apm821xx/files/arch/powerpc/platforms/44x/wndr4700.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Netgear Centria N900 WNDR4700/WNDR4720 platform support - * - * 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; version 2 of the License. - * - * This implemention is based on the simple platform support for the - * PowerPC 44x chips. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -static const struct of_device_id ppc44x_of_bus[] __initconst = { - { .compatible = "ibm,plb4", }, - { .compatible = "ibm,opb", }, - { .compatible = "ibm,ebc", }, - { .compatible = "simple-bus", }, - {}, -}; - -static int __init ppc44x_device_probe(void) -{ - of_platform_bus_probe(NULL, ppc44x_of_bus, NULL); - - return 0; -} -machine_device_initcall(wndr4700, ppc44x_device_probe); - -static char *board[] __initdata = { - "netgear,wndr4700", -}; - -static int __init ppc44x_probe(void) -{ - unsigned long root = of_get_flat_dt_root(); - int i = 0; - - pcie_bus_config = PCIE_BUS_PEER2PEER; /* force 128 Byte MPS */ - - for (i = 0; i < ARRAY_SIZE(board); i++) { - if (of_flat_dt_is_compatible(root, board[i])) { - pci_set_flags(PCI_REASSIGN_ALL_RSRC); /* PCI_PROBE_ONLY */ - return 1; - } - } - - return 0; -} - -define_machine(wndr4700) { - .name = "WNDR4700 Platform", - .probe = ppc44x_probe, - .progress = udbg_progress, - .init_IRQ = uic_init_tree, - .get_irq = uic_get_irq, - .restart = ppc4xx_reset_system, - .calibrate_decr = generic_calibrate_decr, -}; - -static int __init wndr4700_ath9k_eeprom_load(void) -{ - return 0; -} -machine_device_initcall(wndr4700, wndr4700_ath9k_eeprom_load); diff --git a/target/linux/apm821xx/nand/config-default b/target/linux/apm821xx/nand/config-default index f53167f75b..e1874f6164 100644 --- a/target/linux/apm821xx/nand/config-default +++ b/target/linux/apm821xx/nand/config-default @@ -48,5 +48,4 @@ CONFIG_SENSORS_LM90=y CONFIG_SENSORS_TC654=y CONFIG_SWCONFIG=y CONFIG_SWCONFIG_LEDS=y -CONFIG_WNDR4700=y diff --git a/target/linux/apm821xx/patches-5.4/202-add-netgear-wndr4700-support.patch b/target/linux/apm821xx/patches-5.4/202-add-netgear-wndr4700-support.patch deleted file mode 100644 index b0619852b9..0000000000 --- a/target/linux/apm821xx/patches-5.4/202-add-netgear-wndr4700-support.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/arch/powerpc/platforms/44x/Makefile -+++ b/arch/powerpc/platforms/44x/Makefile -@@ -4,6 +4,7 @@ ifneq ($(CONFIG_PPC4xx_CPM),y) - obj-y += idle.o - endif - obj-$(CONFIG_PPC44x_SIMPLE) += ppc44x_simple.o -+obj-$(CONFIG_WNDR4700) += wndr4700.o - obj-$(CONFIG_EBONY) += ebony.o - obj-$(CONFIG_SAM440EP) += sam440ep.o - obj-$(CONFIG_WARP) += warp.o ---- a/arch/powerpc/platforms/44x/Kconfig -+++ b/arch/powerpc/platforms/44x/Kconfig -@@ -243,6 +243,19 @@ config ICON - help - This option enables support for the AMCC PPC440SPe evaluation board. - -+config WNDR4700 -+ bool "WNDR4700" -+ depends on 44x -+ default n -+ select APM821xx -+ select PCI_MSI -+ select PPC4xx_MSI -+ select PPC4xx_PCI_EXPRESS -+ select IBM_EMAC_RGMII -+ select 460EX -+ help -+ This option enables support for the Netgear WNDR4700/WNDR4720 board. -+ - config XILINX_VIRTEX440_GENERIC_BOARD - bool "Generic Xilinx Virtex 5 FXT board support" - depends on 44x From 4ea5d443dbe6e7b38f942d3049080dd4644e63f0 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Wed, 12 Aug 2020 22:03:27 +0200 Subject: [PATCH 08/11] apm821xx: MX60W: enumerate PCIe in device-tree This patch adds the pcie-switch and bridge configuration for the Meraki MX60W. Signed-off-by: Christian Lamparter --- target/linux/apm821xx/dts/meraki-mx60.dts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/target/linux/apm821xx/dts/meraki-mx60.dts b/target/linux/apm821xx/dts/meraki-mx60.dts index 3620005e4d..5998f6960a 100644 --- a/target/linux/apm821xx/dts/meraki-mx60.dts +++ b/target/linux/apm821xx/dts/meraki-mx60.dts @@ -175,6 +175,25 @@ &PCIE0 { /* Leave this enabled as u-boot on the MX60 will disable it for us */ status = "okay"; + + /* + * relevant lspci topology: + * + * -+-[0000:40]---00.0-[41-7f]----00.0 + */ + + bridge@64,0 { + reg = <0x00400000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi0: wifi@65,0 { + /* Atheros AR9380 2.4/5GHz */ + compatible = "pci168c,0030"; + reg = <0x00410000 0 0 0 0>; + }; + }; }; &MSI { From eb6bb94b12a1fa4326a7dad9cc96fcc8df6fb9e9 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Wed, 12 Aug 2020 22:08:42 +0200 Subject: [PATCH 09/11] apm821xx: apm821xx.dtsi fix comment styles Signed-off-by: Christian Lamparter --- target/linux/apm821xx/dts/apm82181.dtsi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/linux/apm821xx/dts/apm82181.dtsi b/target/linux/apm821xx/dts/apm82181.dtsi index 27ec5c3ac9..606b341b96 100644 --- a/target/linux/apm821xx/dts/apm82181.dtsi +++ b/target/linux/apm821xx/dts/apm82181.dtsi @@ -463,7 +463,8 @@ dcr-reg = <0x100 0x020>; sdr-base = <0x300>; - /* Outbound ranges, one memory and one IO, + /* + * Outbound ranges, one memory and one IO, * later cannot be changed */ ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x00000000 0x00000000 0x80000000>, @@ -476,7 +477,8 @@ /* This drives busses 0x40 to 0x7f */ bus-range = <0x40 0x7f>; - /* Legacy interrupts (note the weird polarity, the bridge seems + /* + * Legacy interrupts (note the weird polarity, the bridge seems * to invert PCIe legacy interrupts). * We are de-swizzling here because the numbers are actually for * port of the root complex virtual P2P bridge. But I want From e4c33462f9011dc366303b57fbb7eb29edcd3f4e Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Thu, 13 Aug 2020 17:39:10 +0200 Subject: [PATCH 10/11] apm821xx: use SPDX-License-identifiers Please note that the DTS are based on really old .DTS from vendors themselves. Signed-off-by: Christian Lamparter --- target/linux/apm821xx/dts/apm82181.dtsi | 17 +---------------- target/linux/apm821xx/dts/meraki-mr24.dts | 5 +---- target/linux/apm821xx/dts/meraki-mx60.dts | 5 +---- target/linux/apm821xx/dts/netgear-wndap620.dts | 8 +------- target/linux/apm821xx/dts/netgear-wndap660.dts | 8 +------- target/linux/apm821xx/dts/netgear-wndap6x0.dtsi | 5 +---- target/linux/apm821xx/dts/netgear-wndr4700.dts | 5 +---- target/linux/apm821xx/dts/wd-mybooklive.dts | 5 +---- 8 files changed, 8 insertions(+), 50 deletions(-) diff --git a/target/linux/apm821xx/dts/apm82181.dtsi b/target/linux/apm821xx/dts/apm82181.dtsi index 606b341b96..78679a2343 100644 --- a/target/linux/apm821xx/dts/apm82181.dtsi +++ b/target/linux/apm821xx/dts/apm82181.dtsi @@ -1,24 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Device Tree for Bluestone (APM821xx) board. * * Copyright (c) 2010, Applied Micro Circuits Corporation * Author: Tirumala R Marri - * - * 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * */ #include diff --git a/target/linux/apm821xx/dts/meraki-mr24.dts b/target/linux/apm821xx/dts/meraki-mr24.dts index 97a69e71d1..37032fb865 100644 --- a/target/linux/apm821xx/dts/meraki-mr24.dts +++ b/target/linux/apm821xx/dts/meraki-mr24.dts @@ -1,13 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Device Tree Source for Meraki MR24 (Ikarem) * * Copyright (C) 2016 Chris Blake * * Based on Cisco Meraki GPL Release r23-20150601 MR24 DTS - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without - * any warranty of any kind, whether express or implied. */ /dts-v1/; diff --git a/target/linux/apm821xx/dts/meraki-mx60.dts b/target/linux/apm821xx/dts/meraki-mx60.dts index 5998f6960a..6773028191 100644 --- a/target/linux/apm821xx/dts/meraki-mx60.dts +++ b/target/linux/apm821xx/dts/meraki-mx60.dts @@ -1,13 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Device Tree Source for Meraki MX60/MX60W (Buckminster) * * Copyright (C) 2016 Chris Blake * * Based on Cisco Meraki DTS extracted from release wired-12-217818 - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without - * any warranty of any kind, whether express or implied. */ /dts-v1/; diff --git a/target/linux/apm821xx/dts/netgear-wndap620.dts b/target/linux/apm821xx/dts/netgear-wndap620.dts index b01c2a5d62..e92c5638cb 100644 --- a/target/linux/apm821xx/dts/netgear-wndap620.dts +++ b/target/linux/apm821xx/dts/netgear-wndap620.dts @@ -1,10 +1,4 @@ -/* - * Device Tree Source for Netgear WNDAP620 - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without - * any warranty of any kind, whether express or implied. - */ +// SPDX-License-Identifier: GPL-2.0-only /dts-v1/; diff --git a/target/linux/apm821xx/dts/netgear-wndap660.dts b/target/linux/apm821xx/dts/netgear-wndap660.dts index 5d8fd50b6a..c15970b6b2 100644 --- a/target/linux/apm821xx/dts/netgear-wndap660.dts +++ b/target/linux/apm821xx/dts/netgear-wndap660.dts @@ -1,10 +1,4 @@ -/* - * Device Tree Source for Netgear WNDAP660 - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without - * any warranty of any kind, whether express or implied. - */ +// SPDX-License-Identifier: GPL-2.0-only /dts-v1/; diff --git a/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi b/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi index 2d135d64da..eac54011e7 100644 --- a/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi +++ b/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi @@ -1,9 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Device Tree Source for Netgear WNDAP620 and WNDAP660 - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without - * any warranty of any kind, whether express or implied. */ #include "apm82181.dtsi" diff --git a/target/linux/apm821xx/dts/netgear-wndr4700.dts b/target/linux/apm821xx/dts/netgear-wndr4700.dts index 039c68f30f..f711eb7782 100644 --- a/target/linux/apm821xx/dts/netgear-wndr4700.dts +++ b/target/linux/apm821xx/dts/netgear-wndr4700.dts @@ -1,11 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Device Tree Source for Netgear WNDR4700/WNDR4720 Series * * Copyright 2008 DENX Software Engineering, Stefan Roese - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without - * any warranty of any kind, whether express or implied. */ /dts-v1/; diff --git a/target/linux/apm821xx/dts/wd-mybooklive.dts b/target/linux/apm821xx/dts/wd-mybooklive.dts index 82e9497ecd..3fd636cb23 100644 --- a/target/linux/apm821xx/dts/wd-mybooklive.dts +++ b/target/linux/apm821xx/dts/wd-mybooklive.dts @@ -1,10 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2008 DENX Software Engineering, Stefan Roese * (c) Copyright 2010 Western Digital Technologies, Inc. All Rights Reserved. - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without - * any warranty of any kind, whether express or implied. */ /dts-v1/; From f589bd9283457f0bfddfeb2af468a413a3802b9b Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Thu, 13 Aug 2020 17:47:07 +0200 Subject: [PATCH 11/11] apm821xx: fix typos in .dts files This patch fixes various typos or tab-vs-space issues in the APM821XX device targets Device-Tree source files. Signed-off-by: Christian Lamparter --- target/linux/apm821xx/dts/apm82181.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/apm821xx/dts/apm82181.dtsi b/target/linux/apm821xx/dts/apm82181.dtsi index 78679a2343..5be4487be0 100644 --- a/target/linux/apm821xx/dts/apm82181.dtsi +++ b/target/linux/apm821xx/dts/apm82181.dtsi @@ -25,7 +25,7 @@ #address-cells = <1>; #size-cells = <0>; - CPU00: cpu@0 { + CPU0: cpu@0 { device_type = "cpu"; model = "PowerPC,apm82181"; reg = <0x00000000>; @@ -155,7 +155,7 @@ dcr-reg = <0x240 0x009>; interrupts = <0x1a IRQ_TYPE_LEVEL_HIGH>; interrupt-parent = <&UIC2>; - + status = "disabled"; }; TRNG: trng@110000 {