diff options
33 files changed, 259 insertions, 126 deletions
@@ -1,5 +1,5 @@ VERSION = 2020 -PATCHLEVEL = 04 +PATCHLEVEL = 05 SUBLEVEL = 0 EXTRAVERSION = NAME = None diff --git a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi index 841ad653b2..3cb8b3782a 100644 --- a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi +++ b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi @@ -12,10 +12,7 @@ #include <arm/imx6qdl-phytec-pfla02.dtsi> / { - memory { - /* let barebox fill the memory node */ - reg = <0 0>; - }; + /delete-node/ memory@10000000; chosen { environment-nand { diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h index 4c4b51180c..033341e270 100644 --- a/arch/arm/mach-at91/include/mach/board.h +++ b/arch/arm/mach-at91/include/mach/board.h @@ -147,16 +147,7 @@ static inline struct device_d * at91_register_uart(unsigned id, unsigned pins) } #endif -/* Multimedia Card Interface */ -struct atmel_mci_platform_data { - unsigned slot_b; - unsigned bus_width; - int detect_pin; - int wp_pin; - char *devname; -}; - -void at91_add_device_mci(short mmc_id, struct atmel_mci_platform_data *data); +#include <platform_data/atmel-mci.h> /* SPI Master platform data */ struct at91_spi_platform_data { diff --git a/common/Kconfig b/common/Kconfig index 400c0553cf..44a955c5ff 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -39,8 +39,8 @@ config BLOCK_WRITE bool config ELF - bool - depends on MIPS + bool "ELF Support" if COMPILE_TEST + depends on MIPS || COMPILE_TEST config FILETYPE bool @@ -1336,6 +1336,19 @@ config KASAN Enables KASAN (KernelAddressSANitizer) - runtime memory debugger, designed to find out-of-bounds accesses and use-after-free bugs. +config COMPILE_TEST + bool "compile-test drivers of other platforms" + default n + help + Some drivers can be compiled on a different platform than they are + intended to be run on. Despite they cannot be used there due to + missing HW support, developers still, opposing to users, might want + to build such drivers to compile-test them. + + If you are a developer and want to build as much as currently possible, + say Y here. If you are a user, say N here to avoid being prompted for + inclusion of unrelated drivers. + endmenu config HAS_DEBUG_LL diff --git a/drivers/aiodev/Kconfig b/drivers/aiodev/Kconfig index 7f1d0fd4a9..a4909d8ecd 100644 --- a/drivers/aiodev/Kconfig +++ b/drivers/aiodev/Kconfig @@ -18,7 +18,7 @@ config IMX_THERMAL config QORIQ_THERMAL tristate "QorIQ Thermal Monitoring Unit" - depends on ARCH_IMX8MQ + depends on ARCH_IMX8MQ || COMPILE_TEST help Support for Thermal Monitoring Unit (TMU) found on QorIQ and i.MX8MQ platforms. diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig index 1a2ff9129e..6b4e1d30e3 100644 --- a/drivers/bus/Kconfig +++ b/drivers/bus/Kconfig @@ -7,7 +7,7 @@ config BUS_OMAP_GPMC bool "TI OMAP/AM33xx GPMC support" config TI_SYSC - depends on ARCH_OMAP + depends on ARCH_OMAP || COMPILE_TEST bool "TI sysc interconnect target module driver" default y help @@ -15,7 +15,7 @@ config TI_SYSC found on many TI SoCs. config IMX_WEIM - depends on ARCH_IMX + depends on ARCH_IMX || COMPILE_TEST bool "i.MX WEIM driver" config MVEBU_MBUS diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 8805cda39e..6dfe6151ac 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -12,16 +12,16 @@ config ARM_SMP_TWD depends on ARM && CPU_V7 config CLOCKSOURCE_BCM283X - bool - depends on ARCH_BCM283X + bool "BCM283x clock source" if COMPILE_TEST + depends on ARCH_BCM283X || COMPILE_TEST config CLOCKSOURCE_CLPS711X - bool - depends on ARCH_CLPS711X + bool "CLPS711x clock source" if COMPILE_TEST + depends on ARCH_CLPS711X || COMPILE_TEST config CLOCKSOURCE_DIGIC - bool - depends on ARCH_DIGIC + bool "DIGIC clock source" if COMPILE_TEST + depends on ARCH_DIGIC || COMPILE_TEST config CLOCKSOURCE_DUMMY_RATE int @@ -52,20 +52,20 @@ config CLOCKSOURCE_KVX depends on KVX config CLOCKSOURCE_MVEBU - bool - depends on ARCH_MVEBU + bool "MVEBU clock source" if COMPILE_TEST + depends on ARCH_MVEBU || COMPILE_TEST config CLOCKSOURCE_NOMADIK - bool - depends on ARM + bool "Nomadik clock source" if COMPILE_TEST + depends on ARM || COMPILE_TEST config CLOCKSOURCE_ORION - bool - depends on ARCH_MVEBU + bool "ORION clock source" if COMPILE_TEST + depends on ARCH_MVEBU || COMPILE_TEST config CLOCKSOURCE_UEMD - bool - depends on ARCH_UEMD + bool "UEMD clock source" if COMPILE_TEST + depends on ARCH_UEMD || COMPILE_TEST config CLOCKSOURCE_ROCKCHIP bool @@ -75,16 +75,18 @@ config CLOCKSOURCE_ATMEL_PIT bool config CLOCKSOURCE_ARM_ARCHITECTED_TIMER - bool + bool "ARM architected timer clock source" if COMPILE_TEST default y depends on ARM && (CPU_64v8 || CPU_V7) config CLOCKSOURCE_ARM_GLOBAL_TIMER - bool - depends on ARM && CPU_V7 + bool "ARM global timer clock source" if COMPILE_TEST + depends on (ARM && CPU_V7) || COMPILE_TEST + config CLOCKSOURCE_IMX_GPT - def_bool y - depends on ARCH_HAS_IMX_GPT + bool "i.MX GPT clock source" if COMPILE_TEST + default y if ARCH_HAS_IMX_GPT + depends on ARCH_HAS_IMX_GPT || COMPILE_TEST config CLOCKSOURCE_DW_APB_TIMER bool "DW APB timer driver" diff --git a/drivers/crypto/caam/Kconfig b/drivers/crypto/caam/Kconfig index 6bb8278d69..3981678501 100644 --- a/drivers/crypto/caam/Kconfig +++ b/drivers/crypto/caam/Kconfig @@ -1,6 +1,6 @@ config CRYPTO_DEV_FSL_CAAM bool "Freescale CAAM-Multicore driver backend" - depends on ARCH_IMX6 + depends on ARCH_IMX6 || COMPILE_TEST help Enables the driver module for Freescale's Cryptographic Accelerator and Assurance Module (CAAM), also known as the SEC version 4 (SEC4). diff --git a/drivers/crypto/imx-scc/Kconfig b/drivers/crypto/imx-scc/Kconfig index 531304f432..c3b69b2fd4 100644 --- a/drivers/crypto/imx-scc/Kconfig +++ b/drivers/crypto/imx-scc/Kconfig @@ -1,6 +1,6 @@ config CRYPTO_DEV_MXC_SCC tristate "Support for Freescale Security Controller (SCC)" - depends on ARCH_IMX25 && OFTREE + depends on (ARCH_IMX25 || COMPILE_TEST) && OFTREE select CRYPTO_BLKCIPHER select CRYPTO_DES help @@ -9,6 +9,6 @@ config CRYPTO_DEV_MXC_SCC config CRYPTO_DEV_MXC_SCC_BLOB_GEN tristate "Support for SCC blob gen" - depends on ARCH_IMX25 + depends on ARCH_IMX25 || COMPILE_TEST select BLOBGEN select CRYPTO_DEV_MXC_SCC diff --git a/drivers/ddr/fsl/Kconfig b/drivers/ddr/fsl/Kconfig index 9cae9028a2..09920bb863 100644 --- a/drivers/ddr/fsl/Kconfig +++ b/drivers/ddr/fsl/Kconfig @@ -1,5 +1,5 @@ config DDR_FSL - bool + bool "Freescale DDR support" if COMPILE_TEST if DDR_FSL diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 7e4fc90d39..261b6e6662 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -11,7 +11,7 @@ config GPIO_GENERIC config GPIO_DIGIC bool "GPIO support for Canon DIGIC" - depends on ARCH_DIGIC + depends on ARCH_DIGIC || COMPILE_TEST config GPIO_74164 bool "Generic SPI attached shift register" @@ -23,7 +23,7 @@ config GPIO_74164 config GPIO_CLPS711X bool "GPIO support for CLPS711X" - depends on ARCH_CLPS711X + depends on ARCH_CLPS711X || COMPILE_TEST select GPIO_GENERIC help Say yes here to enable the GPIO driver for the CLPS711X CPUs @@ -31,7 +31,7 @@ config GPIO_CLPS711X config GPIO_DAVINCI bool "TI Davinci/Keystone GPIO support" default y if ARCH_DAVINCI - depends on ARM && ARCH_DAVINCI + depends on (ARM && ARCH_DAVINCI) || COMPILE_TEST help Say yes here to enable GPIO support for TI Davinci/Keystone SoCs. @@ -43,23 +43,26 @@ config GPIO_GENERIC_PLATFORM GPIO controllers config GPIO_IMX - def_bool ARCH_IMX + bool "i.MX GPIO controller" if COMPILE_TEST + default y if ARCH_IMX config GPIO_VF610 - def_bool ARCH_VF610 + bool "VF610 GPIO controller" if COMPILE_TEST + default y if ARCH_VF610 config GPIO_MXS - def_bool ARCH_MXS + bool "MXS GPIO controller" if COMPILE_TEST + default y if ARCH_MXS config GPIO_JZ4740 bool "GPIO support for Ingenic SoCs" - depends on MACH_MIPS_XBURST + depends on MACH_MIPS_XBURST || COMPILE_TEST help Say yes here to enable the GPIO driver for the Ingenic SoCs. config GPIO_MALTA_FPGA_I2C bool "Malta CBUS FPGA I2C GPIO" - depends on MACH_MIPS_MALTA + depends on MACH_MIPS_MALTA || COMPILE_TEST help Support access to the CBUS FPGA I2C lines through the gpio library. @@ -69,18 +72,19 @@ config GPIO_MALTA_FPGA_I2C config GPIO_MPC8XXX bool "MPC512x/MPC8xxx/QorIQ GPIO support" - depends on ARCH_LAYERSCAPE + depends on ARCH_LAYERSCAPE || COMPILE_TEST select GPIO_GENERIC help Say Y here if you're going to use hardware that connects to the MPC512x/831x/834x/837x/8572/8610/QorIQ GPIOs. config GPIO_OMAP - def_bool ARCH_OMAP + bool "OMAP GPIO controller" if COMPILE_TEST + default y if ARCH_OMAP config GPIO_ORION bool "GPIO support for Marvell Orion/MVEBU SoCs" - depends on ARCH_MVEBU + depends on ARCH_MVEBU || COMPILE_TEST help Say yes here to add the driver for the GPIO controller found on Marvell Orion and MVEBU SoCs (Armada 370/XP, @@ -142,7 +146,7 @@ config GPIO_STMPE config GPIO_TEGRA bool "GPIO support for the Tegra SoCs" - depends on ARCH_TEGRA + depends on ARCH_TEGRA || COMPILE_TEST help Say yes here to include the driver for the GPIO controller found on the Tegra line of SoCs. diff --git a/drivers/hw_random/Kconfig b/drivers/hw_random/Kconfig index 4921054568..1923c755db 100644 --- a/drivers/hw_random/Kconfig +++ b/drivers/hw_random/Kconfig @@ -9,14 +9,14 @@ if HWRNG config HWRNG_MXC_RNGC tristate "Freescale i.MX RNGC Random Number Generator" - depends on ARCH_IMX25 || ARCH_IMX35 || ARCH_IMX53 + depends on ARCH_IMX25 || ARCH_IMX35 || ARCH_IMX53 || COMPILE_TEST help This driver provides kernel-side support for the Random Number Generator hardware found on some Freescale i.MX processors. config HWRNG_STM32 tristate "STM32 Random Number Generator" - depends on ARCH_STM32MP + depends on ARCH_STM32MP || COMPILE_TEST help This driver provides barebox support for the Random Number Generator hardware found on the STM32 family of MPUs and MCUs. diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig index e40032d91b..95aa51ebfc 100644 --- a/drivers/input/Kconfig +++ b/drivers/input/Kconfig @@ -27,7 +27,7 @@ config KEYBOARD_GPIO config KEYBOARD_IMX_KEYPAD bool "IMX Keypad" - depends on ARCH_IMX + depends on ARCH_IMX || COMPILE_TEST select INPUT_MATRIXKMAP select POLLER select INPUT diff --git a/drivers/mci/Kconfig b/drivers/mci/Kconfig index 9f56bed3ab..73da291300 100644 --- a/drivers/mci/Kconfig +++ b/drivers/mci/Kconfig @@ -54,6 +54,7 @@ config MCI_DW_PIO config MCI_MXS bool "i.MX23/i.MX28" depends on ARCH_MXS + select STMP_DEVICE help Enable this entry to add support to read and write SD cards on a i.MX23/i.MX28 based system. @@ -67,16 +68,16 @@ config MCI_S3C config MCI_BCM283X bool "MCI support for BCM283X" - depends on ARCH_BCM283X + depends on ARCH_BCM283X || COMPILE_TEST config MCI_BCM283X_SDHOST bool "BCM283X sdhost" - depends on ARCH_BCM283X + depends on ARCH_BCM283X || COMPILE_TEST select MCI_SDHCI config MCI_DOVE bool "Marvell Dove SDHCI" - depends on ARCH_DOVE + depends on ARCH_DOVE || COMPILE_TEST select MCI_SDHCI help Enable this entry to add support to read and write SD cards on a @@ -84,14 +85,14 @@ config MCI_DOVE config MCI_IMX bool "i.MX" - depends on ARCH_IMX27 || ARCH_IMX31 + depends on ARCH_IMX27 || ARCH_IMX31 || COMPILE_TEST help Enable this entry to add support to read and write SD cards on a Freescale i.MX based system. config MCI_IMX_ESDHC bool "i.MX esdhc" - depends on ARCH_IMX || ARCH_LAYERSCAPE + depends on ARCH_IMX || ARCH_LAYERSCAPE || COMPILE_TEST select MCI_SDHCI help Enable this entry to add support to read and write SD cards on a @@ -119,7 +120,7 @@ config MCI_PXA config MCI_ATMEL bool "ATMEL (AT91)" - depends on ARCH_AT91 + depends on ARCH_AT91 || COMPILE_TEST help Enable this entry to add support to read and write SD cards on a Atmel AT91. @@ -133,7 +134,7 @@ config MCI_MMCI config MCI_TEGRA bool "Tegra SD/MMC" - depends on ARCH_TEGRA + depends on ARCH_TEGRA || COMPILE_TEST select MCI_SDHCI help Enable this to support SD and MMC card read/write on a Tegra based diff --git a/drivers/mci/atmel_mci.c b/drivers/mci/atmel_mci.c index 0d3b245ced..b4c4e7769e 100644 --- a/drivers/mci/atmel_mci.c +++ b/drivers/mci/atmel_mci.c @@ -21,9 +21,9 @@ #include <clock.h> #include <gpio.h> #include <io.h> -#include <mach/board.h> #include <linux/clk.h> #include <linux/err.h> +#include <platform_data/atmel-mci.h> #include <of_gpio.h> #include "atmel-mci-regs.h" diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig index 39fd644773..134dc9e37a 100644 --- a/drivers/memory/Kconfig +++ b/drivers/memory/Kconfig @@ -2,7 +2,7 @@ menu "Memory controller drivers" config MC_TEGRA124 bool "Support for Tegra124 memory controller" - depends on ARCH_TEGRA + depends on ARCH_TEGRA || COMPILE_TEST help Say yes here to include the driver for the memory controller found on the Tegra124 SoC. This driver performs the necessary initialization diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 32a2c661fc..42346154e6 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -84,7 +84,7 @@ config SMSC_SUPERIO config MFD_STM32_TIMERS bool "STM32 Timers" - depends on ARCH_STM32MP + depends on ARCH_STM32MP || COMPILE_TEST help Select this to get regmap support for the timer blocks on STM32 MCUs and MPUs. diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig index 3c5da4a40c..fff9903d1d 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig @@ -74,6 +74,7 @@ config NAND_IMX config NAND_MXS bool select NAND_BBT + select STMP_DEVICE prompt "i.MX23/28/6 NAND driver" depends on MXS_APBH_DMA @@ -86,7 +87,7 @@ config NAND_OMAP_GPMC config MTD_NAND_OMAP_ELM bool "Support for ELM (Error Location Module) on OMAP platforms" - depends on NAND_OMAP_GPMC + depends on NAND_OMAP_GPMC || COMPILE_TEST help This config enables the ELM hardware engine, which can be used to locate and correct errors when using BCH ECC scheme. This offloads @@ -97,14 +98,14 @@ config MTD_NAND_OMAP_ELM config NAND_ORION bool prompt "Marvell Orion NAND driver" - depends on ARCH_KIRKWOOD + depends on ARCH_KIRKWOOD || COMPILE_TEST help Support for the Orion NAND controller, present in Kirkwood SoCs. config NAND_MRVL_NFC bool prompt "Marvell PXA3xx NAND driver" - depends on ARCH_ARMADA_370 || ARCH_ARMADA_XP || ARCH_PXA3XX + depends on ARCH_ARMADA_370 || ARCH_ARMADA_XP || ARCH_PXA3XX || COMPILE_TEST help Support for the PXA3xx NAND controller, present in Armada 370/XP and PXA3xx SoCs. @@ -117,7 +118,7 @@ config NAND_ATMEL config NAND_ATMEL_PMECC bool prompt "PMECC support" - depends on NAND_ATMEL + depends on NAND_ATMEL || COMPILE_TEST select NAND_ECC_HW help Support for PMECC present on the SoC sam9x5 and sam9n12 diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 5823320b03..d202d76729 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -48,7 +48,7 @@ config DRIVER_NET_CALXEDA_XGMAC config DRIVER_NET_CS8900 bool "cs8900 ethernet driver" - depends on HAS_CS8900 + depends on HAS_CS8900 || COMPILE_TEST config DRIVER_NET_CPSW bool "CPSW ethernet driver" @@ -78,7 +78,7 @@ config DRIVER_NET_DESIGNWARE_GENERIC config DRIVER_NET_DESIGNWARE_SOCFPGA bool "Designware Universal MAC ethernet driver for SoCFPGA platforms" - depends on ARCH_SOCFPGA + depends on ARCH_SOCFPGA || COMPILE_TEST select MFD_SYSCON select RESET_CONTROLLER help @@ -115,7 +115,7 @@ endif config DRIVER_NET_DM9K bool "Davicom dm9k[E|A|B] ethernet driver" - depends on HAS_DM9000 + depends on HAS_DM9000 || COMPILE_TEST select PHYLIB config DRIVER_NET_E1000 @@ -157,7 +157,7 @@ config DRIVER_NET_ETHOC config DRIVER_NET_FEC_IMX bool "i.MX FEC Ethernet driver" - depends on ARCH_HAS_FEC_IMX + depends on ARCH_HAS_FEC_IMX || COMPILE_TEST select PHYLIB config DRIVER_NET_FSL_FMAN @@ -182,7 +182,7 @@ config DRIVER_NET_KS8851_MLL config DRIVER_NET_MACB bool "macb Ethernet driver" - depends on HAS_MACB + depends on HAS_MACB || COMPILE_TEST select PHYLIB config DRIVER_NET_MICREL diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c index b9a6575009..b01e7ac7a8 100644 --- a/drivers/net/cpsw.c +++ b/drivers/net/cpsw.c @@ -52,6 +52,10 @@ #define CPDMA_DESC_EOP BIT(30) #define CPDMA_DESC_OWNER BIT(29) #define CPDMA_DESC_EOQ BIT(28) +#define CPDMA_DESC_TO_PORT_EN BIT(20) +#define CPDMA_FROM_TO_PORT_SHIFT 16 +#define CPDMA_RX_SOURCE_PORT(__status__) \ + (((__status__) >> CPDMA_FROM_TO_PORT_SHIFT) & 0x7) #define SLIVER_SIZE 0x40 @@ -161,10 +165,12 @@ enum cpsw_ale_port_state { /* ALE unicast entry flags - passed into cpsw_ale_add_ucast() */ #define ALE_SECURE 1 #define ALE_BLOCKED 2 +#define ALE_VLAN 4 struct cpsw_slave { struct cpsw_slave_regs *regs; struct cpsw_sliver_regs *sliver; + int port_vlan; int slave_num; int phy_id; phy_interface_t phy_if; @@ -258,6 +264,7 @@ static inline void cpsw_ale_set_##name(u32 *ale_entry, u32 value) \ } DEFINE_ALE_FIELD(entry_type, 60, 2) +DEFINE_ALE_FIELD(vlan_id, 48, 12) DEFINE_ALE_FIELD(mcast_state, 62, 2) DEFINE_ALE_FIELD(port_mask, 66, 3) DEFINE_ALE_FIELD(ucast_type, 62, 2) @@ -265,6 +272,10 @@ DEFINE_ALE_FIELD(port_num, 66, 2) DEFINE_ALE_FIELD(blocked, 65, 1) DEFINE_ALE_FIELD(secure, 64, 1) DEFINE_ALE_FIELD(mcast, 40, 1) +DEFINE_ALE_FIELD(vlan_untag, 24, 3) +DEFINE_ALE_FIELD(vlan_reg_mcast, 16, 3) +DEFINE_ALE_FIELD(vlan_unreg_mcast, 8, 3) +DEFINE_ALE_FIELD(vlan_member_list, 0, 3) static char ethbdaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; @@ -309,6 +320,23 @@ static int cpsw_ale_write(struct cpsw_priv *priv, int idx, u32 *ale_entry) return idx; } +static int cpsw_ale_match_vlan(struct cpsw_priv *priv, u16 vid) +{ + u32 ale_entry[ALE_ENTRY_WORDS]; + int type, idx; + + for (idx = 0; idx < priv->ale_entries; idx++) { + cpsw_ale_read(priv, idx, ale_entry); + type = cpsw_ale_get_entry_type(ale_entry); + if (type != ALE_TYPE_VLAN) + continue; + if (cpsw_ale_get_vlan_id(ale_entry) == vid) + return idx; + } + + return -ENOENT; +} + static int cpsw_ale_match_addr(struct cpsw_priv *priv, u8* addr) { u32 ale_entry[ALE_ENTRY_WORDS]; @@ -373,13 +401,47 @@ static int cpsw_ale_find_ageable(struct cpsw_priv *priv) return -ENOENT; } +static int cpsw_ale_add_vlan(struct cpsw_priv *priv, u16 vid, int port_mask, + int untag, int reg_mcast, int unreg_mcast) +{ + u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0}; + int idx; + + idx = cpsw_ale_match_vlan(priv, vid); + if (idx >= 0) + cpsw_ale_read(priv, idx, ale_entry); + + cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_VLAN); + cpsw_ale_set_vlan_id(ale_entry, vid); + cpsw_ale_set_vlan_untag(ale_entry, untag); + cpsw_ale_set_vlan_reg_mcast(ale_entry, reg_mcast); + cpsw_ale_set_vlan_unreg_mcast(ale_entry, unreg_mcast); + cpsw_ale_set_vlan_member_list(ale_entry, port_mask); + + if (idx < 0) + idx = cpsw_ale_match_free(priv); + if (idx < 0) + idx = cpsw_ale_find_ageable(priv); + if (idx < 0) + return -ENOMEM; + + cpsw_ale_write(priv, idx, ale_entry); + return 0; +} + static int cpsw_ale_add_ucast(struct cpsw_priv *priv, u8 *addr, - int port, int flags) + int port, int flags, u16 vid) { u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0}; int idx; - cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_ADDR); + if (flags & ALE_VLAN) { + cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_VLAN_ADDR); + cpsw_ale_set_vlan_id(ale_entry, vid); + } else { + cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_ADDR); + } + cpsw_ale_set_addr(ale_entry, addr); cpsw_ale_set_ucast_type(ale_entry, ALE_UCAST_PERSISTANT); cpsw_ale_set_secure(ale_entry, (flags & ALE_SECURE) ? 1 : 0); @@ -398,7 +460,8 @@ static int cpsw_ale_add_ucast(struct cpsw_priv *priv, u8 *addr, return 0; } -static int cpsw_ale_add_mcast(struct cpsw_priv *priv, u8 *addr, int port_mask) +static int cpsw_ale_add_mcast(struct cpsw_priv *priv, u8 *addr, int port_mask, + int flags, u16 vid, int mcast_state) { u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0}; int idx, mask; @@ -407,9 +470,14 @@ static int cpsw_ale_add_mcast(struct cpsw_priv *priv, u8 *addr, int port_mask) if (idx >= 0) cpsw_ale_read(priv, idx, ale_entry); - cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_ADDR); + if (flags & ALE_VLAN) { + cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_VLAN_ADDR); + cpsw_ale_set_vlan_id(ale_entry, vid); + } else { + cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_ADDR); + } cpsw_ale_set_addr(ale_entry, addr); - cpsw_ale_set_mcast_state(ale_entry, ALE_MCAST_FWD_2); + cpsw_ale_set_mcast_state(ale_entry, mcast_state); mask = cpsw_ale_get_port_mask(ale_entry); port_mask |= mask; @@ -673,6 +741,7 @@ static inline u32 cpsw_get_slave_port(struct cpsw_priv *priv, u32 slave_num) static void cpsw_slave_init(struct cpsw_slave *slave, struct cpsw_priv *priv) { u32 slave_port; + u32 port_mask; dev_dbg(&slave->dev, "* %s\n", __func__); @@ -689,8 +758,22 @@ static void cpsw_slave_init(struct cpsw_slave *slave, struct cpsw_priv *priv) slave_port = cpsw_get_slave_port(priv, slave->slave_num); cpsw_ale_port_state(priv, slave_port, ALE_PORT_STATE_FORWARD); + port_mask = BIT(slave_port) | BIT(priv->host_port); + + /* set port_vlan to host_vlan */ + writel(BIT(slave->slave_num), &slave->regs->port_vlan); + slave->port_vlan = readl(&slave->regs->port_vlan); + slave->port_vlan &= 0xfff; + + /* add dual emac default entries */ + cpsw_ale_add_vlan(priv, slave->port_vlan, port_mask, + port_mask, port_mask, 0); /* add broadcast address */ - cpsw_ale_add_mcast(priv, ethbdaddr, 1 << slave_port); + cpsw_ale_add_mcast(priv, ethbdaddr, BIT(priv->host_port), ALE_VLAN, + slave->port_vlan, 0); + cpsw_ale_add_ucast(priv, priv->mac_addr, priv->host_port, + ALE_SECURE | ALE_VLAN, + slave->port_vlan); } static struct cpdma_desc *cpdma_desc_alloc(struct cpsw_priv *priv) @@ -714,7 +797,7 @@ static void cpdma_desc_free(struct cpsw_priv *priv, struct cpdma_desc *desc) } static int cpdma_submit(struct cpsw_priv *priv, struct cpdma_chan *chan, - void *buffer, int len) + void *buffer, int len, int port) { struct cpdma_desc *desc, *prev; u32 mode; @@ -728,6 +811,10 @@ static int cpdma_submit(struct cpsw_priv *priv, struct cpdma_chan *chan, mode = CPDMA_DESC_OWNER | CPDMA_DESC_SOP | CPDMA_DESC_EOP; + if (port) + mode |= CPDMA_DESC_TO_PORT_EN | + (port << CPDMA_FROM_TO_PORT_SHIFT); + writel(0, &desc->hw_next); writel((u32)buffer, &desc->hw_buffer); writel(len, &desc->hw_len); @@ -758,10 +845,11 @@ done: return 0; } -static int cpdma_process(struct cpsw_priv *priv, struct cpdma_chan *chan, +static int cpdma_process(struct cpsw_slave *slave, struct cpdma_chan *chan, void **buffer, int *len) { struct cpdma_desc *desc = chan->head; + struct cpsw_priv *priv = slave->cpsw; u32 status; if (!desc) @@ -783,6 +871,14 @@ static int cpdma_process(struct cpsw_priv *priv, struct cpdma_chan *chan, return -EBUSY; } + /* cpsw_send is cleaning finished descriptors on next send + * so we only have to check for rx channel here + */ + if (CPDMA_RX_SOURCE_PORT(status) != BIT(slave->slave_num) && + chan == &priv->rx_chan) { + return -ENOMSG; + } + chan->head = (void *)readl(&desc->hw_next); writel((u32)desc, chan->cp); @@ -801,7 +897,7 @@ static int cpsw_open(struct eth_device *edev) { struct cpsw_slave *slave = edev->priv; struct cpsw_priv *priv = slave->cpsw; - int i, ret; + int ret; dev_dbg(&slave->dev, "* %s\n", __func__); @@ -810,6 +906,16 @@ static int cpsw_open(struct eth_device *edev) if (ret) return ret; + cpsw_slave_init(slave, priv); + + return 0; +} + +static int cpsw_setup(struct device_d *dev) +{ + struct cpsw_priv *priv = dev->priv; + int i, ret; + /* soft reset the controller and initialize priv */ soft_reset(priv, &priv->regs->soft_reset); @@ -817,7 +923,10 @@ static int cpsw_open(struct eth_device *edev) cpsw_ale_enable(priv, 1); cpsw_ale_clear(priv, 1); cpsw_ale_bypass(priv, 0); - cpsw_ale_vlan_aware(priv, 0); /* vlan unaware mode */ + cpsw_ale_vlan_aware(priv, 1); /* vlan aware mode */ + + /* dual mac mode in fifo */ + writel(BIT(16), &priv->host_port_regs->flow_thresh); /* setup host port priority mapping */ writel(0x76543210, &priv->host_port_regs->cpdma_tx_pri_map); @@ -831,12 +940,6 @@ static int cpsw_open(struct eth_device *edev) cpsw_ale_port_state(priv, priv->host_port, ALE_PORT_STATE_FORWARD); - cpsw_ale_add_ucast(priv, priv->mac_addr, priv->host_port, - ALE_SECURE); - cpsw_ale_add_mcast(priv, ethbdaddr, 1 << priv->host_port); - - cpsw_slave_init(slave, priv); - /* init descriptor pool */ for (i = 0; i < NUM_DESCS; i++) { u32 val = (i == (NUM_DESCS - 1)) ? 0 : (u32)&priv->descs[i + 1]; @@ -873,9 +976,9 @@ static int cpsw_open(struct eth_device *edev) /* submit rx descs */ for (i = 0; i < PKTBUFSRX - 2; i++) { ret = cpdma_submit(priv, &priv->rx_chan, NetRxPackets[i], - PKTSIZE); + PKTSIZE, 0); if (ret < 0) { - dev_err(&slave->dev, "error %d submitting rx desc\n", ret); + dev_err(dev, "error %d submitting rx desc\n", ret); break; } } @@ -910,12 +1013,13 @@ static int cpsw_send(struct eth_device *edev, void *packet, int length) dev_dbg(&slave->dev, "* %s slave %d\n", __func__, slave->slave_num); /* first reap completed packets */ - while (cpdma_process(priv, &priv->tx_chan, &buffer, &len) >= 0); + while (cpdma_process(slave, &priv->tx_chan, &buffer, &len) >= 0); dev_dbg(&slave->dev, "%s: %i bytes @ 0x%p\n", __func__, length, packet); dma_sync_single_for_device((unsigned long)packet, length, DMA_TO_DEVICE); - ret = cpdma_submit(priv, &priv->tx_chan, packet, length); + ret = cpdma_submit(priv, &priv->tx_chan, packet, + length, BIT(slave->slave_num)); dma_sync_single_for_cpu((unsigned long)packet, length, DMA_TO_DEVICE); return ret; @@ -928,13 +1032,13 @@ static int cpsw_recv(struct eth_device *edev) void *buffer; int len; - while (cpdma_process(priv, &priv->rx_chan, &buffer, &len) >= 0) { + while (cpdma_process(slave, &priv->rx_chan, &buffer, &len) >= 0) { dma_sync_single_for_cpu((unsigned long)buffer, len, DMA_FROM_DEVICE); net_receive(edev, buffer, len); dma_sync_single_for_device((unsigned long)buffer, len, DMA_FROM_DEVICE); - cpdma_submit(priv, &priv->rx_chan, buffer, PKTSIZE); + cpdma_submit(priv, &priv->rx_chan, buffer, PKTSIZE, 0); } return 0; @@ -1015,7 +1119,7 @@ static struct cpsw_data cpsw1_data = { .cpdma_reg_ofs = 0x100, .state_ram_ofs = 0x200, .ale_reg_ofs = 0x600, - .slave_ofs = 0x050, + .slave_ofs = 0x058, .slave_size = 0x040, .sliver_ofs = 0x700, /* FIXME: mdio_reg_ofs and cppi_ram_ofs missing */ @@ -1026,7 +1130,7 @@ static struct cpsw_data cpsw2_data = { .cpdma_reg_ofs = 0x800, .state_ram_ofs = 0xa00, .ale_reg_ofs = 0xd00, - .slave_ofs = 0x200, + .slave_ofs = 0x208, .slave_size = 0x100, .sliver_ofs = 0xd80, .mdio_reg_ofs = 0x1000, @@ -1241,6 +1345,8 @@ static int cpsw_probe(struct device_d *dev) dev->priv = priv; + cpsw_setup(dev); + return 0; out: free(priv->slaves); diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index 2806af376f..6cb162a437 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -68,7 +68,7 @@ comment "MII bus device drivers" config MDIO_MVEBU bool "Driver for MVEBU SoC MDIO bus" - depends on ARCH_MVEBU + depends on ARCH_MVEBU || COMPILE_TEST help Driver for the MDIO bus found on Marvell EBU SoCs. diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig index 025c418f2b..0585460976 100644 --- a/drivers/pci/Kconfig +++ b/drivers/pci/Kconfig @@ -1,5 +1,5 @@ config HW_HAS_PCI - bool + bool "Compile in PCI core" if COMPILE_TEST if HW_HAS_PCI @@ -49,7 +49,7 @@ config PCI_IMX6 config PCI_LAYERSCAPE bool "Freescale Layerscape PCIe controller" - depends on ARCH_LAYERSCAPE + depends on ARCH_LAYERSCAPE || COMPILE_TEST select PCIE_DW select OF_PCI select PCI diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index b5c8e98b9e..0b513b68d0 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig @@ -26,7 +26,7 @@ source "drivers/phy/freescale/Kconfig" config PHY_STM32_USBPHYC tristate "STM32 USB HS PHY Controller" - depends on ARCH_STM32MP + depends on ARCH_STM32MP || COMPILE_TEST help Enable this to support the High-Speed USB transceivers that are part of some STMicroelectronics STM32 SoCs. diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index fd75ea6a4f..589b0e768f 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -19,7 +19,7 @@ config PINCTRL_AT91 config PINCTRL_BCM283X bool "GPIO and pinmux support for BCM283X" - depends on ARCH_BCM283X + depends on ARCH_BCM283X || COMPILE_TEST help The pinmux controller on BCM2835 @@ -57,7 +57,7 @@ config PINCTRL_AT91PIO4 config PINCTRL_MXS bool "MXS pinctrl" - depends on ARCH_MXS + depends on ARCH_MXS || COMPILE_TEST default ARCH_MXS help This pinmux controller is found on i.MX23,28 @@ -73,20 +73,20 @@ config PINCTRL_SINGLE bool "pinctrl single" config PINCTRL_TEGRA20 - bool + bool "Tegra20 pinctrl support" if COMPILE_TEST default y if ARCH_TEGRA_2x_SOC help The pinmux controller found on the Tegra 20 line of SoCs. config PINCTRL_TEGRA30 - bool + bool "Tegra30 pinctrl support" if COMPILE_TEST default y if ARCH_TEGRA_3x_SOC default y if ARCH_TEGRA_124_SOC help The pinmux controller found on the Tegra 30+ line of SoCs. config PINCTRL_TEGRA_XUSB - bool + bool "Tegra SerDes pinmux support" if COMPILE_TEST default y if ARCH_TEGRA_124_SOC select GENERIC_PHY help @@ -102,7 +102,7 @@ config PINCTRL_VF610 Pinmux controller found on Vybrid VF610 family of SoCs config PINCTRL_STM32 - bool + bool "STM32 pinctrl support" if COMPILE_TEST default y if ARCH_STM32MP help Pinmux and GPIO controller found on STM32 family diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index 9268aac912..478ea49eed 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -18,19 +18,20 @@ config PWM_PXA config PWM_IMX bool "i.MX PWM Support" - depends on ARCH_IMX + depends on ARCH_IMX || COMPILE_TEST help This enables PWM support for Freescale i.MX SoCs config PWM_MXS bool "i.MXs PWM Support" depends on ARCH_MXS + select STMP_DEVICE help This enables PWM support for Freescale i.MX23/i.MX28 SoCs config PWM_STM32 bool "STM32 PWM Support" - depends on ARCH_STM32MP + depends on ARCH_STM32MP || COMPILE_TEST help This enables PWM support for STM32 MCUs and MPUs. diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index bd02fe2137..14cd430ee4 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -48,6 +48,7 @@ config DRIVER_SERIAL_STM378X config DRIVER_SERIAL_AUART depends on ARCH_MXS + select STMP_DEVICE bool "i.MX23/i.MX28 application UART serial driver" config DRIVER_SERIAL_LINUX_CONSOLE diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index c696213f50..323d93efeb 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -77,7 +77,7 @@ config DRIVER_SPI_IMX_2_3 config DRIVER_SPI_MXS bool "i.MX (23,28) SPI Master driver" depends on ARCH_IMX28 - depends on SPI + select STMP_DEVICE config DRIVER_SPI_MVEBU bool "Marvell MVEBU SoC SPI master driver" diff --git a/drivers/video/ssd1307fb.c b/drivers/video/ssd1307fb.c index 835814bf53..45f479b0ef 100644 --- a/drivers/video/ssd1307fb.c +++ b/drivers/video/ssd1307fb.c @@ -395,7 +395,7 @@ static int ssd1307fb_probe(struct device_d *dev) u32 vmem_size; struct ssd1307fb_par *par; struct ssd1307fb_array *array; - u8 *vmem; + u8 *vmem = NULL; int ret; int i, j; diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index fe979d9306..d9734ef588 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -18,7 +18,7 @@ config WATCHDOG_POLLER config WATCHDOG_AR9344 bool "QCA AR9344" - depends on SOC_QCA_AR9344 || SOC_QCA_AR9331 + depends on SOC_QCA_AR9344 || SOC_QCA_AR9331 || COMPILE_TEST help Add support for watchdog on the QCA AR9344 SoC. @@ -30,7 +30,7 @@ config WATCHDOG_EFI config WATCHDOG_DAVINCI bool "TI Davinci" - depends on ARCH_DAVINCI + depends on ARCH_DAVINCI || COMPILE_TEST help Add support for watchdog on the TI Davinci SoC. @@ -42,31 +42,31 @@ config WATCHDOG_DW config WATCHDOG_MXS28 bool "i.MX28" - depends on ARCH_IMX28 + depends on ARCH_IMX28 || COMPILE_TEST help Add support for watchdog management for the i.MX28 SoC. config WATCHDOG_IMX bool "i.MX watchdog" - depends on ARCH_IMX || ARCH_LAYERSCAPE + depends on ARCH_IMX || ARCH_LAYERSCAPE || COMPILE_TEST help Add support for watchdog found on Freescale i.MX SoCs. config WATCHDOG_JZ4740 bool "Ingenic jz4740 SoC hardware watchdog" - depends on MACH_MIPS_XBURST + depends on MACH_MIPS_XBURST || COMPILE_TEST help Hardware driver for the built-in watchdog timer on Ingenic jz4740 SoCs. config WATCHDOG_OMAP bool "TI OMAP" - depends on ARCH_OMAP + depends on ARCH_OMAP || COMPILE_TEST help Add support for watchdog on the TI OMAP SoC. config WATCHDOG_ORION bool "Watchdog for Armada XP" - depends on ARCH_ARMADA_XP + depends on ARCH_ARMADA_XP || COMPILE_TEST help Add support for watchdog on the Marvall Armada XP @@ -78,7 +78,7 @@ config WATCHDOG_KVX config WATCHDOG_BCM2835 bool "Watchdog for BCM283x SoCs" - depends on ARCH_BCM283X + depends on ARCH_BCM283X || COMPILE_TEST help Add support for watchdog on the Broadcom BCM283X SoCs. @@ -90,7 +90,7 @@ config RAVE_SP_WATCHDOG config STM32_IWDG_WATCHDOG bool "STM32 IWDG" - depends on ARCH_STM32MP + depends on ARCH_STM32MP || COMPILE_TEST select MFD_SYSCON help Enable to support configuration of the STM32's on-SoC IWDG watchdog. @@ -223,6 +223,7 @@ int ftruncate(int fd, loff_t length) } f->size = length; + f->f_inode->i_size = f->size; return 0; } diff --git a/include/platform_data/atmel-mci.h b/include/platform_data/atmel-mci.h new file mode 100644 index 0000000000..d99ee3d138 --- /dev/null +++ b/include/platform_data/atmel-mci.h @@ -0,0 +1,15 @@ +#ifndef PLATFORM_DATA_ATMEL_MCI_H +#define PLATFORM_DATA_ATMEL_MCI_H + +/* Multimedia Card Interface */ +struct atmel_mci_platform_data { + unsigned slot_b; + unsigned bus_width; + int detect_pin; + int wp_pin; + char *devname; +}; + +void at91_add_device_mci(short mmc_id, struct atmel_mci_platform_data *data); + +#endif /* PLATFORM_DATA_ATMEL_MCI_H */ diff --git a/lib/Kconfig b/lib/Kconfig index 9a80780186..081fffbd70 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -94,7 +94,7 @@ config IMAGE_SPARSE bool config STMP_DEVICE - bool + bool "STMP device support" if COMPILE_TEST config FSL_QE_FIRMWARE select CRC32 diff --git a/scripts/Makefile.build b/scripts/Makefile.build index a6ed83e6d2..4cac47fdb2 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -258,7 +258,7 @@ pbl-%.o: %.S FORCE $(call if_changed_dep,as_o_S) targets += $(real-objs-y) $(real-objs-m) $(lib-y) $(pbl-y) -targets += $(extra-y) $(MAKECMDGOALS) $(always) +targets += $(extra-y) $(always-y) $(MAKECMDGOALS) # Linker scripts preprocessor (.lds.S -> .lds) # --------------------------------------------------------------------------- |