MIPS Boston board support
Subsystems (18)
cover MIPS Boston board support
This series introduces support for the Imagination Technologies MIPS Boston development board. Boston is an FPGA-based development board akin to the much older Malta board, built around a Xilinx FPGA running a MIPS CPU & other logic including a PCIe root port connected to an Intel EG20T Platform Controller Hub. This provides a base set of peripherals including SATA, USB, SD/MMC, ethernet, I2C & GPIOs. PCIe slots are also present for expansion.
Paul Burton (28):
serial: earlycon: allow MEM32 I/O for DT earlycon
dt-bindings: ascii-lcd: Document a binding for simple ASCII LCDs
auxdisplay: driver for simple memory mapped ASCII LCD displays
MIPS: PCI: compatibility with ARM-like PCI host drivers
PCI: xilinx: keep references to both IRQ domains
PCI: xilinx: unify INTx & MSI interrupt FIFO decode
PCI: xilinx: always clear interrupt decode register
PCI: xilinx: fix INTX irq dispatch
PCI: xilinx: allow build on MIPS platforms
misc: pch_phub: allow build on MIPS platforms
dmaengine: pch_dma: allow build on MIPS platforms
gpio: pch: allow build on MIPS platforms
gpio: pch: allow use from device tree
i2c: eg20t: allow build on MIPS platforms
i2c: eg20t: set i2c_adapter->dev.of_node
rtc: m41t80: add devicetree probe support
spi: topcliff-pch: allow build for MIPS platforms
ptp: pch: allow build on MIPS platforms
net: pch_gbe: allow build on MIPS platforms
net: pch_gbe: clear interrupt FIFO during probe
net: pch_gbe: mark Minnow PHY reset GPIO active low
net: pch_gbe: pull PHY GPIO handling out of Minnow code
net: pch_gbe: always reset PHY along with MAC
net: pch_gbe: add device tree support
net: pch_gbe: allow longer for resets
MIPS: support for generating FIT (.itb) images
dt-bindings: mips: img,boston: Document img,boston binding
MIPS: Boston board support
Documentation/devicetree/bindings/ascii-lcd.txt | 10 + .../devicetree/bindings/mips/img/boston.txt | 15 ++ MAINTAINERS | 14 ++ arch/mips/Kbuild.platforms | 1 + arch/mips/Kconfig | 45 ++++ arch/mips/Makefile | 6 +- arch/mips/boot/Makefile | 61 ++++++ arch/mips/boot/dts/Makefile | 1 + arch/mips/boot/dts/img/Makefile | 7 + arch/mips/boot/dts/img/boston.dts | 201 ++++++++++++++++++ arch/mips/boot/skeleton.its | 24 +++ arch/mips/boston/Makefile | 12 ++ arch/mips/boston/Platform | 8 + arch/mips/boston/init.c | 75 +++++++ arch/mips/boston/int.c | 33 +++ arch/mips/boston/time.c | 89 ++++++++ arch/mips/boston/vmlinux.its | 23 ++ arch/mips/configs/boston_defconfig | 170 +++++++++++++++ .../asm/mach-boston/cpu-feature-overrides.h | 26 +++ arch/mips/include/asm/mach-boston/irq.h | 18 ++ arch/mips/include/asm/mach-boston/spaces.h | 20 ++ arch/mips/include/asm/pci.h | 67 +++++- arch/mips/lib/iomap-pci.c | 2 +- arch/mips/pci/Makefile | 6 + arch/mips/pci/pci-generic.c | 138 ++++++++++++ arch/mips/pci/pci-legacy.c | 232 +++++++++++++++++++++ arch/mips/pci/pci.c | 226 +------------------- drivers/auxdisplay/Kconfig | 7 + drivers/auxdisplay/Makefile | 1 + drivers/auxdisplay/ascii-lcd.c | 230 ++++++++++++++++++++ drivers/dma/Kconfig | 2 +- drivers/gpio/Kconfig | 2 +- drivers/gpio/gpio-pch.c | 1 + drivers/i2c/busses/Kconfig | 2 +- drivers/i2c/busses/i2c-eg20t.c | 1 + drivers/misc/Kconfig | 2 +- drivers/net/ethernet/oki-semi/pch_gbe/Kconfig | 2 +- drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h | 4 +- .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 74 +++++-- drivers/of/fdt.c | 2 +- drivers/pci/host/Kconfig | 2 +- drivers/pci/host/pcie-xilinx.c | 123 +++++------ drivers/ptp/Kconfig | 2 +- drivers/rtc/rtc-m41t80.c | 26 +++ drivers/spi/Kconfig | 2 +- drivers/tty/serial/Makefile | 1 + drivers/tty/serial/earlycon.c | 15 +- include/linux/serial_core.h | 2 +- 48 files changed, 1720 insertions(+), 313 deletions(-) create mode 100644 Documentation/devicetree/bindings/ascii-lcd.txt create mode 100644 Documentation/devicetree/bindings/mips/img/boston.txt create mode 100644 arch/mips/boot/dts/img/Makefile create mode 100644 arch/mips/boot/dts/img/boston.dts create mode 100644 arch/mips/boot/skeleton.its create mode 100644 arch/mips/boston/Makefile create mode 100644 arch/mips/boston/Platform create mode 100644 arch/mips/boston/init.c create mode 100644 arch/mips/boston/int.c create mode 100644 arch/mips/boston/time.c create mode 100644 arch/mips/boston/vmlinux.its create mode 100644 arch/mips/configs/boston_defconfig create mode 100644 arch/mips/include/asm/mach-boston/cpu-feature-overrides.h create mode 100644 arch/mips/include/asm/mach-boston/irq.h create mode 100644 arch/mips/include/asm/mach-boston/spaces.h create mode 100644 arch/mips/pci/pci-generic.c create mode 100644 arch/mips/pci/pci-legacy.c create mode 100644 drivers/auxdisplay/ascii-lcd.c
Signature · 1 line
2.6.2
PATCH 1/28 serial: earlycon: allow MEM32 I/O for DT earlycon
Read the reg-io-width property when earlycon is setup via device tree, and set the I/O type to UPIO_MEM32 when 4 is read. This behaviour matches that of the of_serial driver, and is needed for DT configured earlycon on the MIPS Boston board.
Note that this is only possible when CONFIG_LIBFDT is enabled, but enabling it everywhere seems like overkill. Thus systems that need this functionality should select CONFIG_LIBFDT for themselves.
---
drivers/of/fdt.c | 2 +- drivers/tty/serial/Makefile | 1 + drivers/tty/serial/earlycon.c | 15 ++++++++++++++- include/linux/serial_core.h | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-)
drivers/of/fdt.c +1 -1
@@ -833,7 +833,7 @@ static int __init early_init_dt_scan_chosen_serial(void)if (addr ==OF_BAD_ADDR )return -ENXIO ; -of_setup_earlycon (addr, match->data); +of_setup_earlycon (fdt, offset, addr, match->data);return 0 ; }return -ENODEV ;
drivers/tty/serial/Makefile +1 -0
@@ -7,6 +7,7 @@ obj-$(CONFIG_SERIAL_21285) += 21285.o obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o obj-$(CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST) += earlycon-arm-semihost.o +CFLAGS_earlycon.o += -I$(srctree)/scripts/dtc/libfdt # These Sparc drivers have to appear before others such as 8250 # which share ttySx minor node space. Otherwise console device
drivers/tty/serial/earlycon.c +14 -1
@@ -17,6 +17,7 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/io.h> +#include <linux/libfdt.h> #include <linux/serial_core.h> #include <linux/sizes.h> #include <linux/mod_devicetable.h>
@@ -196,17 +197,29 @@ static int __init param_setup_earlycon(char *buf) }early_param ("earlycon" , param_setup_earlycon); -int __init of_setup_earlycon (unsigned long addr, +int __init of_setup_earlycon (const void *fdt,int offset,unsigned long addr,int (*setup)(struct earlycon_device *,const char *)) {int err;struct uart_port *port = &early_console_dev.port; +const __be32 *prop; port->iotype =UPIO_MEM ; port->mapbase = addr; port->uartclk =BASE_BAUD *16 ; port->membase =earlycon_map (addr,SZ_4K ); +if (config_enabled (CONFIG_LIBFDT )) { + prop =fdt_getprop (fdt, offset,"reg-io-width" ,NULL ); +if (prop) { +switch (be32_to_cpup (prop)) { +case 4 : + port->iotype =UPIO_MEM32 ; +break ; + } + } + } + early_console_dev.con->data = &early_console_dev; err =setup (&early_console_dev,NULL );if (err <0 )
include/linux/serial_core.h +1 -1
@@ -345,7 +345,7 @@ struct earlycon_id { }__aligned(32) ;extern int setup_earlycon (char *buf); -extern int of_setup_earlycon (unsigned long addr, +extern int of_setup_earlycon (const void *fdt,int offset,unsigned long addr,int (*setup)(struct earlycon_device *,const char *));#define EARLYCON_DECLARE (_name, func) \
Signature · 1 line
2.6.2
Re: [PATCH 01/28] serial: earlycon: allow MEM32 I/O for DT earlycon
Quoted 8 lines · Paul Burton
Read the reg-io-width property when earlycon is setup via device tree, and set the I/O type to
UPIO_MEM32when 4 is read. This behaviour matches that of theof_serialdriver, and is needed for DT configured earlycon on the MIPS Boston board.Note that this is only possible when
CONFIG_LIBFDTis enabled, but enabling it everywhere seems like overkill. Thus systems that need this functionality should selectCONFIG_LIBFDTfor themselves.
libfdt is enabled if you are booting from DT, so checking this property should not add anything.
Quoted 28 lines
Signed-off-by Paul Burton <[email protected]>---
drivers/of/fdt.c | 2 +- drivers/tty/serial/Makefile | 1 + drivers/tty/serial/earlycon.c | 15 ++++++++++++++- include/linux/serial_core.h | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-)drivers/of/fdt.c +1
-1@@ -833,7 +833,7 @@ static int __init early_init_dt_scan_chosen_serial(void)if (addr ==OF_BAD_ADDR )return -ENXIO ; -of_setup_earlycon (addr, match->data); +of_setup_earlycon (fdt, offset, addr, match->data);return 0 ; }return -ENODEV ;drivers/tty/serial/Makefile +0
-0
drivers/tty/serial/Makefile obj-$(CONFIG_SERIAL_21285) += 21285.o · line 10
Quoted 4 lines
drivers/tty/serial/Makefile +1
-0@@ -7,6 +7,7 @@ obj-$(CONFIG_SERIAL_21285) += 21285.o obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o obj-$(CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST) += earlycon-arm-semihost.o +CFLAGS_earlycon.o += -I$(srctree)/scripts/dtc/libfdt
This is no longer necessary.
Quoted 16 lines
drivers/tty/serial/Makefile +0
-0# These Sparc drivers have to appear before others such as 8250 # which share ttySx minor node space. Otherwise console devicedrivers/tty/serial/earlycon.c +1
-0@@ -17,6 +17,7 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/io.h> +#include <linux/libfdt.h> #include <linux/serial_core.h> #include <linux/sizes.h> #include <linux/mod_devicetable.h>
drivers/tty/serial/earlycon.c static int __init param_setup_earlycon(char *buf) · line 200
Quoted 5 lines
drivers/tty/serial/earlycon.c +1
-1@@ -196,17 +197,29 @@ static int __init param_setup_earlycon(char *buf) }early_param ("earlycon" , param_setup_earlycon); -int __init of_setup_earlycon(unsigned long addr, +int __init of_setup_earlycon(const void *fdt, int offset, unsigned long addr,
I would add iotype as a parameter instead, and then...
Quoted 10 lines
drivers/tty/serial/earlycon.c +1
-0int (*setup)(struct earlycon_device *, const char *)) {int err;struct uart_port *port = &early_console_dev.port; +const __be32 *prop; port->iotype =UPIO_MEM ; port->mapbase = addr; port->uartclk =BASE_BAUD *16 ; port->membase =earlycon_map (addr,SZ_4K );
drivers/tty/serial/earlycon.c static int __init param_setup_earlycon(char *buf) · line 220
Quoted 10 lines
drivers/tty/serial/earlycon.c +9
-0+if (config_enabled (CONFIG_LIBFDT )) { + prop =fdt_getprop (fdt, offset,"reg-io-width" ,NULL ); +if (prop) { +switch (be32_to_cpup (prop)) { +case 4 : + port->iotype =UPIO_MEM32 ; +break ; + } + }
...move this parsing into fdt.c where we parse the address.
Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 01/28] serial: earlycon: allow MEM32 I/O for DT earlycon
Quoted 93 lines · Rob Herring
Quoted 8 lines · Paul Burton
Read the reg-io-width property when earlycon is setup via device tree, and set the I/O type to
UPIO_MEM32when 4 is read. This behaviour matches that of theof_serialdriver, and is needed for DT configured earlycon on the MIPS Boston board.Note that this is only possible when
CONFIG_LIBFDTis enabled, but enabling it everywhere seems like overkill. Thus systems that need this functionality should selectCONFIG_LIBFDTfor themselves.libfdt is enabled if you are booting from DT, so checking this property should not add anything.
Quoted 28 lines
Signed-off-by Paul Burton <[email protected]>---
drivers/of/fdt.c | 2 +- drivers/tty/serial/Makefile | 1 + drivers/tty/serial/earlycon.c | 15 ++++++++++++++- include/linux/serial_core.h | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-)drivers/of/fdt.c +1
-1@@ -833,7 +833,7 @@ static int __init early_init_dt_scan_chosen_serial(void)if (addr ==OF_BAD_ADDR )return -ENXIO ; -of_setup_earlycon (addr, match->data); +of_setup_earlycon (fdt, offset, addr, match->data);return 0 ; }return -ENODEV ;drivers/tty/serial/Makefile +0
-0drivers/tty/serial/Makefile obj-$(CONFIG_SERIAL_21285) += 21285.o · line 10
Quoted 4 lines
drivers/tty/serial/Makefile +1
-0@@ -7,6 +7,7 @@ obj-$(CONFIG_SERIAL_21285) += 21285.o obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o obj-$(CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST) += earlycon-arm-semihost.o +CFLAGS_earlycon.o += -I$(srctree)/scripts/dtc/libfdtThis is no longer necessary.
Quoted 16 lines
drivers/tty/serial/Makefile +0
-0# These Sparc drivers have to appear before others such as 8250 # which share ttySx minor node space. Otherwise console devicedrivers/tty/serial/earlycon.c +1
-0@@ -17,6 +17,7 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/io.h> +#include <linux/libfdt.h> #include <linux/serial_core.h> #include <linux/sizes.h> #include <linux/mod_devicetable.h> drivers/tty/serial/earlycon.c static int __init param_setup_earlycon(char *buf) · line 200
Quoted 5 lines
drivers/tty/serial/earlycon.c +1
-1@@ -196,17 +197,29 @@ static int __init param_setup_earlycon(char *buf) }early_param ("earlycon" , param_setup_earlycon); -int __init of_setup_earlycon(unsigned long addr, +int __init of_setup_earlycon(const void *fdt, int offset, unsigned long addr,I would add iotype as a parameter instead, and then...
Quoted 10 lines
drivers/tty/serial/earlycon.c +1
-0int (*setup)(struct earlycon_device *, const char *)) {int err;struct uart_port *port = &early_console_dev.port; +const __be32 *prop; port->iotype =UPIO_MEM ; port->mapbase = addr; port->uartclk =BASE_BAUD *16 ; port->membase =earlycon_map (addr,SZ_4K );drivers/tty/serial/earlycon.c static int __init param_setup_earlycon(char *buf) · line 220
Quoted 10 lines
drivers/tty/serial/earlycon.c +9
-0+if (config_enabled (CONFIG_LIBFDT )) { + prop =fdt_getprop (fdt, offset,"reg-io-width" ,NULL ); +if (prop) { +switch (be32_to_cpup (prop)) { +case 4 : + port->iotype =UPIO_MEM32 ; +break ; + } + }
Quoted 1 line
...move this parsing into
fdt.cwhere we parse the address.
FWIW, all of of_setup_earlycon() should only be #ifdef CONFIG_OF_EARLY_FLATTREE
Regards,
Peter Hurley
PATCH 2/28 dt-bindings: ascii-lcd: Document a binding for simple ASCII LCDs
In reply to Paul BurtonAdd documentation for a devicetree binding for simple memory-mapped ASCII LCD displays, such as those found on the Imagination Technologies Boston & Malta development boards.
---
Documentation/devicetree/bindings/ascii-lcd.txt | 10 ++++++++++ MAINTAINERS | 5 +++++ 2 files changed, 15 insertions(+) create mode 100644 Documentation/devicetree/bindings/ascii-lcd.txt
Documentation/devicetree/bindings/ascii-lcd.txt new file +10 -0
@@ -0,0 +1,10 @@ +Binding for simple memory-mapped ASCII LCD displays + +Required properties: +- compatible : should be one of: + "img,boston-lcd" + "mti,malta-lcd" +- reg : memory region locating the device registers + +The layout of the registers & properties of the display are determined +from the compatible string, making this binding somewhat trivial.
MAINTAINERS +5 -0
@@ -1782,6 +1782,11 @@ S: Maintained F: Documentation/hwmon/asc7621 F: drivers/hwmon/asc7621.c +ASCII LCD DRIVER +M: Paul Burton <[email protected]> +S: Maintained +F: Documentation/devicetree/bindings/ascii-lcd.txt + ASUS NOTEBOOKS AND EEEPC ACPI/WMI EXTRAS DRIVERS M: Corentin Chary <[email protected]> L: [email protected]
Signature · 6 lines
2.6.2 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Rob Herring
maintainerRe: [PATCH 02/28] dt-bindings: ascii-lcd: Document a binding for simple ASCII LCDs
Quoted 8 lines · Paul Burton
Add documentation for a devicetree binding for simple memory-mapped ASCII LCD displays, such as those found on the Imagination Technologies Boston & Malta development boards.
Signed-off-by Paul Burton <[email protected]>---
Documentation/devicetree/bindings/ascii-lcd.txt | 10 ++++++++++
This should go under bindings/display/.
Documentation/devicetree/bindings/ascii-lcd.txt line 1
Quoted 11 lines
MAINTAINERS | 5 +++++ 2 files changed, 15 insertions(+) create mode 100644 Documentation/devicetree/bindings/ascii-lcd.txtDocumentation/devicetree/bindings/ascii-lcd.txt new file +1
-0@@ -0,0 +1,10 @@ +Binding for simple memory-mapped ASCII LCD displays
Presumably, this is a binding for the controller, not the actual display. You need to more fully describe what the h/w looks like here. Like what is the interface between the controller and display?
Rob
Quoted 28 lines
Documentation/devicetree/bindings/ascii-lcd.txt new file +9
-0+ +Required properties: +- compatible : should be one of: + "img,boston-lcd" + "mti,malta-lcd" +- reg : memory region locating the device registers + +The layout of the registers & properties of the display are determined +from the compatible string, making this binding somewhat trivial.MAINTAINERS +5
-0@@ -1782,6 +1782,11 @@ S: Maintained F: Documentation/hwmon/asc7621 F: drivers/hwmon/asc7621.c +ASCII LCD DRIVER +M: Paul Burton <[email protected]> +S: Maintained +F: Documentation/devicetree/bindings/ascii-lcd.txt + ASUS NOTEBOOKS AND EEEPC ACPI/WMI EXTRAS DRIVERS M: Corentin Chary <[email protected]> L: [email protected]Signature · 1 line
2.6.2
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/28 auxdisplay: driver for simple memory mapped ASCII LCD displays
In reply to Paul BurtonAdd a driver for simple memory mapped ASCII LCD displays such as those found on the MIPS Malta & Boston development boards. The driver displays the Linux kernel version as the default message, but allows the message to be changed via a character device. Messages longer then the number of characters that the display can show will scroll.
This provides different behaviour to the existing LCD display code for the MIPS Malta platform in the following ways:
- The default string to display is not "LINUX ON MALTA" but "Linux" followed by the version number of the kernel (UTS_RELEASE).
- Since that string tends to significantly longer it scrolls twice as fast, moving every 500ms rather than every 1s.
- The LCD won't be updated until the driver is probed, so it doesn't provide the early "LINUX" string.
---
MAINTAINERS | 1 + drivers/auxdisplay/Kconfig | 7 ++ drivers/auxdisplay/Makefile | 1 + drivers/auxdisplay/ascii-lcd.c | 230 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 239 insertions(+) create mode 100644 drivers/auxdisplay/ascii-lcd.c
MAINTAINERS +1 -0
@@ -1786,6 +1786,7 @@ ASCII LCD DRIVER M: Paul Burton <[email protected]> S: Maintained F: Documentation/devicetree/bindings/ascii-lcd.txt +F: drivers/auxdisplay/ascii-lcd.c ASUS NOTEBOOKS AND EEEPC ACPI/WMI EXTRAS DRIVERS M: Corentin Chary <[email protected]>
drivers/auxdisplay/Kconfig +7 -0
@@ -119,4 +119,11 @@ config CFAG12864B_RATE If you compile this as a module, you can still override this value using the module parameters. +config ASCII_LCD + tristate "ASCII LCD Display" + default y if MIPS_MALTA + help + Enable this to support simple memory mapped ASCII LCD displays such + as those found on the MIPS Malta & Boston development boards. + endif # AUXDISPLAY
drivers/auxdisplay/Makefile +1 -0
@@ -4,3 +4,4 @@ obj-$(CONFIG_KS0108) += ks0108.o obj-$(CONFIG_CFAG12864B) += cfag12864b.o cfag12864bfb.o +obj-$(CONFIG_ASCII_LCD) += ascii-lcd.o
drivers/auxdisplay/ascii-lcd.c new file +230 -0
230 lines not on this page · raw message
Signature · 1 line
2.6.2
PATCH 4/28 MIPS: PCI: compatibility with ARM-like PCI host drivers
In reply to Paul BurtonIntroduce support for struct hw_pci & the associated pci_common_init_dev function as used by the PCI drivers written for ARM platforms under drivers/pci. This is in preparation for reusing the xilinx-pcie driver on the MIPS Boston board.
Platforms that make use of this more generic code will need to select CONFIG_MIPS_GENERIC_PCI. Platforms which don't will continue to work as they have, with the intent that PCI drivers be migrated towards struct hw_pci & drivers/pci/ over time.
---
arch/mips/Kconfig | 6 ++ arch/mips/include/asm/pci.h | 67 ++++++++++++- arch/mips/lib/iomap-pci.c | 2 +- arch/mips/pci/Makefile | 6 ++ arch/mips/pci/pci-generic.c | 138 ++++++++++++++++++++++++++ arch/mips/pci/pci-legacy.c | 232 ++++++++++++++++++++++++++++++++++++++++++++ arch/mips/pci/pci.c | 226 ++---------------------------------------- 7 files changed, 456 insertions(+), 221 deletions(-) create mode 100644 arch/mips/pci/pci-generic.c create mode 100644 arch/mips/pci/pci-legacy.c
arch/mips/Kconfig +6 -0
@@ -2834,11 +2834,14 @@ config HW_HAS_EISA bool config HW_HAS_PCI bool +config MIPS_GENERIC_PCI + bool config PCI bool "Support for PCI controller" depends on HW_HAS_PCI select PCI_DOMAINS + select PCI_DOMAINS_GENERIC if MIPS_GENERIC_PCI select NO_GENERIC_PCI_IOPORT_MAP help Find out whether you have a PCI motherboard. PCI is the name of a
@@ -2860,6 +2863,9 @@ config HT_PCI config PCI_DOMAINS bool +config PCI_DOMAINS_GENERIC + bool + source "drivers/pci/Kconfig" source "drivers/pci/pcie/Kconfig"
arch/mips/include/asm/pci.h +64 -3
105 lines not on this page · raw message
arch/mips/lib/iomap-pci.c +1 -1
@@ -13,7 +13,7 @@void __iomem *__pci_ioport_map (struct pci_dev *dev,unsigned long port,unsigned int nr) { -struct pci_controller *ctrl = dev->bus->sysdata; +struct pci_controller *ctrl =sysdata_to_hose (dev->bus->sysdata);unsigned long base = ctrl->io_map_base;/* This will eventually become a BUG_ON but for now be gentle */
arch/mips/pci/Makefile +6 -0
@@ -4,6 +4,12 @@ obj-y += pci.o +ifeq ($(CONFIG_MIPS_GENERIC_PCI),y) +obj-y += pci-generic.o +else +obj-y += pci-legacy.o +endif + # # PCI bus host bridge specific code #
arch/mips/pci/pci-generic.c new file +138 -0
138 lines not on this page · raw message
arch/mips/pci/pci-legacy.c new file +232 -0
232 lines not on this page · raw message
arch/mips/pci/pci.c +9 -217
270 lines not on this page · raw message
Signature · 1 line
2.6.2
PATCH 5/28 PCI: xilinx: keep references to both IRQ domains
In reply to Paul Burtonpcie-xilinx creates 2 IRQ domains when built with MSI support: one for MSI interrupts & one for legacy INTx interrupts. However, it only kept a reference to the MSI IRQ domain. This means that any INTx interrupts that may occur would be mapped using the wrong domain, and that only the MSI IRQ domain would be removed along with the driver. Track both IRQ domains & clean up both as appropriate.
---
drivers/pci/host/pcie-xilinx.c | 58 ++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 30 deletions(-)
drivers/pci/host/pcie-xilinx.c +28 -30
@@ -105,6 +105,7 @@* @root_busno: Root Bus number * @dev: Device pointer * @irq_domain: IRQ domain pointer +* @msi_irq_domain: MSI IRQ domain pointer * @bus_range: Bus range * @resources: Bus Resources */
@@ -115,6 +116,7 @@ struct xilinx_pcie_port {u8 root_busno;struct device *dev;struct irq_domain *irq_domain; +struct irq_domain *msi_irq_domain;struct resource bus_range;struct list_head resources; };
@@ -291,7 +293,7 @@ static int xilinx_pcie_msi_setup_irq(struct msi_controller *chip,if (hwirq <0 )return hwirq; - irq =irq_create_mapping (port->irq_domain, hwirq); + irq =irq_create_mapping (port->msi_irq_domain, hwirq);if (!irq)return -EINVAL ;
@@ -517,31 +519,21 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)/** * xilinx_pcie_free_irq_domain - Free IRQ domain -* @port: PCIe port information +* @domain: the IRQ domain to free +* @nr: the number of IRQs in the domain */ -static void xilinx_pcie_free_irq_domain (struct xilinx_pcie_port *port) +static void xilinx_pcie_free_irq_domain (struct irq_domain *domain,int nr) {int i; -u32 irq, num_irqs; - -/* Free IRQ Domain */ -if (IS_ENABLED (CONFIG_PCI_MSI )) { - -free_pages (port->msi_pages,0 ); - - num_irqs =XILINX_NUM_MSI_IRQS ; - }else { -/* INTx */ - num_irqs =4 ; - } +u32 irq; -for (i =0 ; i < num_irqs; i++) { - irq =irq_find_mapping (port->irq_domain, i); +for (i =0 ; i < nr; i++) { + irq =irq_find_mapping (domain, i);if (irq >0 )irq_dispose_mapping (irq); } -irq_domain_remove (port->irq_domain); +irq_domain_remove (domain); }/**
@@ -571,20 +563,20 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port)return PTR_ERR (port->irq_domain); } -/* Setup MSI */ -if (IS_ENABLED (CONFIG_PCI_MSI )) { - port->irq_domain =irq_domain_add_linear (node, -XILINX_NUM_MSI_IRQS , - &msi_domain_ops, - &xilinx_pcie_msi_chip); -if (!port->irq_domain) { -dev_err (dev,"Failed to get a MSI IRQ domain\n" ); -return PTR_ERR (port->irq_domain); - } +if (!IS_ENABLED (CONFIG_PCI_MSI )) +return 0 ; -xilinx_pcie_enable_msi (port); +/* Setup MSI */ + port->msi_irq_domain =irq_domain_add_linear (node, +XILINX_NUM_MSI_IRQS , + &msi_domain_ops, + &xilinx_pcie_msi_chip); +if (!port->msi_irq_domain) { +dev_err (dev,"Failed to get a MSI IRQ domain\n" ); +return PTR_ERR (port->msi_irq_domain); } +xilinx_pcie_enable_msi (port);return 0 ; }
@@ -868,7 +860,13 @@ static int xilinx_pcie_remove(struct platform_device *pdev) {struct xilinx_pcie_port *port =platform_get_drvdata (pdev); -xilinx_pcie_free_irq_domain (port); +xilinx_pcie_free_irq_domain (port->irq_domain,4 ); + +if (config_enabled (CONFIG_MSI )) { +free_pages (port->msi_pages,0 ); +xilinx_pcie_free_irq_domain (port->msi_irq_domain, +XILINX_NUM_MSI_IRQS ); + }return 0 ; }
Signature · 1 line
2.6.2
Re: [PATCH 05/28] PCI: xilinx: keep references to both IRQ domains
Hi Paul,
Please capitalize the first word of your PCI changelog subjects.
Quoted 6 lines · Paul Burton
pcie-xilinx creates 2 IRQ domains when built with MSI support: one for MSI interrupts & one for legacy INTx interrupts. However, it only kept a reference to the MSI IRQ domain. This means that any INTx interrupts that may occur would be mapped using the wrong domain, and that only the MSI IRQ domain would be removed along with the driver. Track both IRQ domains & clean up both as appropriate.
It looks like this fixes a problem in the original commit 8961def56845 ("PCI: xilinx: Add Xilinx AXI PCIe Host Bridge IP driver"), which appeared in v3.18. Does this need a stable backport tag?
It sounds like any device using INTx just won't work? From later patches, I surmise that this series might be related to using Xilinx in a new MIPS Boston board. If that's the case, and pre-v4.5 kernels don't support that board anyway, a stable backport might not be needed. It *does* fix a leak even if you don't need INTx, but that seems minor and probably not worth a stable backport all by itself.
I probably *would* add a 'Fixes: 8961def56845 ("PCI: xilinx: Add Xilinx AXI PCIe Host Bridge IP driver")' line to leave breadcrumbs for people backporting things.
This seems to be part of a larger series -- can these PCI patches go through my tree, or do they all need to go together because of dependencies on the rest of the series?
They all need acks from Michal, of course.
Quoted 129 lines
Signed-off-by Paul Burton <[email protected]>---
drivers/pci/host/pcie-xilinx.c | 58 ++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 30 deletions(-)drivers/pci/host/pcie-xilinx.c +28
-30@@ -105,6 +105,7 @@* @root_busno: Root Bus number * @dev: Device pointer * @irq_domain: IRQ domain pointer +* @msi_irq_domain: MSI IRQ domain pointer * @bus_range: Bus range * @resources: Bus Resources */ @@ -115,6 +116,7 @@ struct xilinx_pcie_port {u8 root_busno;struct device *dev;struct irq_domain *irq_domain; +struct irq_domain *msi_irq_domain;struct resource bus_range;struct list_head resources; };@@ -291,7 +293,7 @@ static int xilinx_pcie_msi_setup_irq(struct msi_controller *chip,if (hwirq <0 )return hwirq; - irq =irq_create_mapping (port->irq_domain, hwirq); + irq =irq_create_mapping (port->msi_irq_domain, hwirq);if (!irq)return -EINVAL ;@@ -517,31 +519,21 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)/** * xilinx_pcie_free_irq_domain - Free IRQ domain -* @port: PCIe port information +* @domain: the IRQ domain to free +* @nr: the number of IRQs in the domain */ -static void xilinx_pcie_free_irq_domain (struct xilinx_pcie_port *port) +static void xilinx_pcie_free_irq_domain (struct irq_domain *domain,int nr) {int i; -u32 irq, num_irqs; - -/* Free IRQ Domain */ -if (IS_ENABLED (CONFIG_PCI_MSI )) { - -free_pages (port->msi_pages,0 ); - - num_irqs =XILINX_NUM_MSI_IRQS ; - }else { -/* INTx */ - num_irqs =4 ; - } +u32 irq; -for (i =0 ; i < num_irqs; i++) { - irq =irq_find_mapping (port->irq_domain, i); +for (i =0 ; i < nr; i++) { + irq =irq_find_mapping (domain, i);if (irq >0 )irq_dispose_mapping (irq); } -irq_domain_remove (port->irq_domain); +irq_domain_remove (domain); }/** @@ -571,20 +563,20 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port)return PTR_ERR (port->irq_domain); } -/* Setup MSI */ -if (IS_ENABLED (CONFIG_PCI_MSI )) { - port->irq_domain =irq_domain_add_linear (node, -XILINX_NUM_MSI_IRQS , - &msi_domain_ops, - &xilinx_pcie_msi_chip); -if (!port->irq_domain) { -dev_err (dev,"Failed to get a MSI IRQ domain\n" ); -return PTR_ERR (port->irq_domain); - } +if (!IS_ENABLED (CONFIG_PCI_MSI )) +return 0 ; -xilinx_pcie_enable_msi (port); +/* Setup MSI */ + port->msi_irq_domain =irq_domain_add_linear (node, +XILINX_NUM_MSI_IRQS , + &msi_domain_ops, + &xilinx_pcie_msi_chip); +if (!port->msi_irq_domain) { +dev_err (dev,"Failed to get a MSI IRQ domain\n" ); +return PTR_ERR (port->msi_irq_domain); } +xilinx_pcie_enable_msi (port);return 0 ; }@@ -868,7 +860,13 @@ static int xilinx_pcie_remove(struct platform_device *pdev) {struct xilinx_pcie_port *port =platform_get_drvdata (pdev); -xilinx_pcie_free_irq_domain (port); +xilinx_pcie_free_irq_domain (port->irq_domain,4 ); + +if (config_enabled (CONFIG_MSI )) { +free_pages (port->msi_pages,0 ); +xilinx_pcie_free_irq_domain (port->msi_irq_domain, +XILINX_NUM_MSI_IRQS ); + }return 0 ; }Signature · 7 lines
2.6.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
PATCH 6/28 PCI: xilinx: unify INTx & MSI interrupt FIFO decode
In reply to Paul BurtonWhen decoding either an INTx or MSI interrupt, the driver has no way to know which it will pull out of the interrupt FIFO. If both were pending then this would lead to either the interrupt being handled incorrectly (MSI interrupt treated as INTx) or not at all (INTx interrupt dropped by MSI path). Unify the reading of the interrupt FIFO & act according to the type of interrupt actually read.
---
drivers/pci/host/pcie-xilinx.c | 45 +++++++++++------------------------------- 1 file changed, 12 insertions(+), 33 deletions(-)
drivers/pci/host/pcie-xilinx.c +12 -33
@@ -397,7 +397,7 @@ static const struct irq_domain_ops intx_domain_ops = {static irqreturn_t xilinx_pcie_intr_handler (int irq,void *data) {struct xilinx_pcie_port *port = (struct xilinx_pcie_port *)data; -u32 val, mask, status, msi_data; +u32 val, mask, status;/* Read interrupt decode and mask registers */ val =pcie_read (port,XILINX_PCIE_REG_IDR );
@@ -437,8 +437,8 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)xilinx_pcie_clear_err_interrupts (port); } -if (status &XILINX_PCIE_INTR_INTX ) { -/* INTx interrupt received */ +if (status & (XILINX_PCIE_INTR_INTX |XILINX_PCIE_INTR_MSI )) { +/* Interrupt received */ val =pcie_read (port,XILINX_PCIE_REG_RPIFR1 );/* Check whether interrupt valid */
@@ -447,41 +447,20 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)return IRQ_HANDLED ; } -if (!(val &XILINX_PCIE_RPIFR1_MSI_INTR )) { -/* Clear interrupt FIFO register 1 */ -pcie_write (port,XILINX_PCIE_RPIFR1_ALL_MASK , -XILINX_PCIE_REG_RPIFR1 ); - -/* Handle INTx Interrupt */ +if (val &XILINX_PCIE_RPIFR1_MSI_INTR ) { + irq =pcie_read (port,XILINX_PCIE_REG_RPIFR2 ) & +XILINX_PCIE_RPIFR2_MSG_DATA ; + }else { val = ((val &XILINX_PCIE_RPIFR1_INTR_MASK ) >>XILINX_PCIE_RPIFR1_INTR_SHIFT ) +1 ; -generic_handle_irq (irq_find_mapping (port->irq_domain, - val)); + irq =irq_find_mapping (port->irq_domain, val); } - } -if (status &XILINX_PCIE_INTR_MSI ) { -/* MSI Interrupt */ - val =pcie_read (port,XILINX_PCIE_REG_RPIFR1 ); +/* Clear interrupt FIFO register 1 */ +pcie_write (port,XILINX_PCIE_RPIFR1_ALL_MASK , +XILINX_PCIE_REG_RPIFR1 ); -if (!(val &XILINX_PCIE_RPIFR1_INTR_VALID )) { -dev_warn (port->dev,"RP Intr FIFO1 read error\n" ); -return IRQ_HANDLED ; - } - -if (val &XILINX_PCIE_RPIFR1_MSI_INTR ) { - msi_data =pcie_read (port,XILINX_PCIE_REG_RPIFR2 ) & -XILINX_PCIE_RPIFR2_MSG_DATA ; - -/* Clear interrupt FIFO register 1 */ -pcie_write (port,XILINX_PCIE_RPIFR1_ALL_MASK , -XILINX_PCIE_REG_RPIFR1 ); - -if (IS_ENABLED (CONFIG_PCI_MSI )) { -/* Handle MSI Interrupt */ -generic_handle_irq (msi_data); - } - } +generic_handle_irq (irq); }if (status &XILINX_PCIE_INTR_SLV_UNSUPP )
Signature · 1 line
2.6.2
PATCH 7/28 PCI: xilinx: always clear interrupt decode register
In reply to Paul BurtonIf an MSI or INTx interrupt is incorrectly triggered with an empty FIFO then xilinx_pcie_intr_handler will print a warning & skip further processing. However it did not clear the interrupt in the decode register, so the same INTX or MSI interrupt would trigger again immediately even though the FIFO is still empty. Clear the interrupt in the decode register to avoid that situation.
---
drivers/pci/host/pcie-xilinx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pci/host/pcie-xilinx.c +2 -1
@@ -444,7 +444,7 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)/* Check whether interrupt valid */ if (!(val &XILINX_PCIE_RPIFR1_INTR_VALID )) {dev_warn (port->dev,"RP Intr FIFO1 read error\n" ); -return IRQ_HANDLED ; + goto out; }if (val &XILINX_PCIE_RPIFR1_MSI_INTR ) {
@@ -490,6 +490,7 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)if (status &XILINX_PCIE_INTR_MST_ERRP )dev_warn (port->dev,"Master error poison\n" ); +out:/* Clear the Interrupt Decode register */ pcie_write (port, status,XILINX_PCIE_REG_IDR );
Signature · 1 line
2.6.2
PATCH 8/28 PCI: xilinx: fix INTX irq dispatch
In reply to Paul BurtonThe IRQ domain for INTX interrupts has 4 entries, numbered 0 to 3. This matches what the hardware reports from the interrupt FIFO exactly, but xilinx_pcie_intr_handler was adding 1 to that value to convert to the range 1 to 4. Stop adding 1, such that all of INTA through to INTD fall within the range of the IRQ domain.
---
drivers/pci/host/pcie-xilinx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/host/pcie-xilinx.c +2 -2
@@ -451,8 +451,8 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data) irq =pcie_read (port,XILINX_PCIE_REG_RPIFR2 ) &XILINX_PCIE_RPIFR2_MSG_DATA ; }else { - val = ((val &XILINX_PCIE_RPIFR1_INTR_MASK ) >> -XILINX_PCIE_RPIFR1_INTR_SHIFT ) +1 ; + val = (val &XILINX_PCIE_RPIFR1_INTR_MASK ) >> +XILINX_PCIE_RPIFR1_INTR_SHIFT ; irq =irq_find_mapping (port->irq_domain, val); }
Signature · 1 line
2.6.2
PATCH 9/28 PCI: xilinx: allow build on MIPS platforms
In reply to Paul BurtonAllow the xilinx-pcie driver to be built on MIPS platforms. This will be used on the MIPS Boston board.
---
drivers/pci/host/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/host/Kconfig +1 -1
@@ -81,7 +81,7 @@ config PCI_KEYSTONE config PCIE_XILINX bool "Xilinx AXI PCIe host bridge support" - depends on ARCH_ZYNQ + depends on ARCH_ZYNQ || MIPS help Say 'Y' here if you want kernel to support the Xilinx AXI PCIe Host Bridge driver.
Signature · 1 line
2.6.2
PATCH 10/28 misc: pch_phub: allow build on MIPS platforms
In reply to Paul BurtonAllow the pch_phub driver to be build on MIPS platforms, in preparation for its use on the MIPS Boston board.
---
drivers/misc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/Kconfig +1 -1
@@ -469,7 +469,7 @@ config BMP085_SPI config PCH_PHUB tristate "Intel EG20T PCH/LAPIS Semicon IOH(ML7213/ML7223/ML7831) PHUB" select GENERIC_NET_UTILS - depends on PCI && (X86_32 || COMPILE_TEST) + depends on PCI && (X86_32 || MIPS || COMPILE_TEST) help This driver is for PCH(Platform controller Hub) PHUB(Packet Hub) of Intel Topcliff which is an IOH(Input/Output Hub) for x86 embedded
Signature · 1 line
2.6.2
PATCH 11/28 dmaengine: pch_dma: allow build on MIPS platforms
In reply to Paul BurtonAllow the pch_dma driver to be built on MIPS platforms, in preparation for use on the MIPS Boston board.
---
drivers/dma/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/Kconfig +1 -1
@@ -376,7 +376,7 @@ config NBPFAXI_DMA config PCH_DMA tristate "Intel EG20T PCH / LAPIS Semicon IOH(ML7213/ML7223/ML7831) DMA" - depends on PCI && (X86_32 || COMPILE_TEST) + depends on PCI && (X86_32 || MIPS || COMPILE_TEST) select DMA_ENGINE help Enable support for Intel EG20T PCH DMA engine.
Signature · 1 line
2.6.2
Re: [PATCH 11/28] dmaengine: pch_dma: allow build on MIPS platforms
Quoted 2 lines · Paul Burton
Allow the
pch_dmadriver to be built on MIPS platforms, in preparation for use on the MIPS Boston board.
Signature · 1 line
~Vinod
PATCH 12/28 gpio: pch: allow build on MIPS platforms
In reply to Paul BurtonAllow the pch_gpio driver to be built for MIPS platforms, in preparation for use on the MIPS Boston board.
---
drivers/gpio/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/Kconfig +1 -1
@@ -952,7 +952,7 @@ config GPIO_ML_IOH config GPIO_PCH tristate "Intel EG20T PCH/LAPIS Semiconductor IOH(ML7223/ML7831) GPIO" - depends on PCI && (X86_32 || COMPILE_TEST) + depends on PCI && (X86_32 || MIPS || COMPILE_TEST) select GENERIC_IRQ_CHIP help This driver is for PCH(Platform controller Hub) GPIO of Intel Topcliff
Signature · 1 line
2.6.2
Re: [PATCH 12/28] gpio: pch: allow build on MIPS platforms
Quoted 4 lines · Paul Burton
Allow the
pch_gpiodriver to be built for MIPS platforms, in preparation for use on the MIPS Boston board.Signed-off-by Paul Burton <[email protected]>
Patch applied to the GPIO tree.
All GPIO patches should go separately to the GPIO tree, especially this merge window as I'm doing refactorings.
Yours,
Linus Walleij
PATCH 13/28 gpio: pch: allow use from device tree
In reply to Paul BurtonAllow GPIOs from the gpio-pch driver to be referenced from device tree by simply setting the struct gpio_chip of_node pointer to that of the struct pci_dev.
---
drivers/gpio/gpio-pch.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpio-pch.c +1 -0
@@ -394,6 +394,7 @@ static int pch_gpio_probe(struct pci_dev *pdev,pci_set_drvdata (pdev, chip);spin_lock_init (&chip->spinlock);pch_gpio_setup (chip); + chip->gpio.of_node = pdev->dev.of_node; ret =gpiochip_add (&chip->gpio);if (ret) {dev_err (&pdev->dev,"PCH gpio: Failed to register GPIO\n" );
Signature · 1 line
2.6.2
Re: [PATCH 13/28] gpio: pch: allow use from device tree
Quoted 5 lines · Paul Burton
Allow GPIOs from the gpio-pch driver to be referenced from device tree by simply setting the struct
gpio_chipof_nodepointer to that of the structpci_dev.Signed-off-by Paul Burton <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 14/28 i2c: eg20t: allow build on MIPS platforms
In reply to Paul BurtonAllow the eg20t I2C driver to be built for MIPS platforms, in preparation for use on the MIPS Boston board.
---
drivers/i2c/busses/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/Kconfig +1 -1
@@ -516,7 +516,7 @@ config I2C_EFM32 config I2C_EG20T tristate "Intel EG20T PCH/LAPIS Semicon IOH(ML7213/ML7223/ML7831) I2C" - depends on PCI && (X86_32 || COMPILE_TEST) + depends on PCI && (X86_32 || MIPS || COMPILE_TEST) help This driver is for PCH(Platform controller Hub) I2C of EG20T which is an IOH(Input/Output Hub) for x86 embedded processor.
Signature · 1 line
2.6.2
Wolfram Sang
AppliedRe: [PATCH 14/28] i2c: eg20t: allow build on MIPS platforms
Quoted 4 lines · Paul Burton
Allow the eg20t I2C driver to be built for MIPS platforms, in preparation for use on the MIPS Boston board.
Signed-off-by Paul Burton <[email protected]>
Applied to for-next, thanks!
PATCH 15/28 i2c: eg20t: set i2c_adapter->dev.of_node
In reply to Paul BurtonSet the I2C adapter devices of_node to that of the PCI device, such that I2C clients may be instantiated via device tree.
---
drivers/i2c/busses/i2c-eg20t.c | 1 + 1 file changed, 1 insertion(+)
drivers/i2c/busses/i2c-eg20t.c +1 -0
@@ -795,6 +795,7 @@ static int pch_i2c_probe(struct pci_dev *pdev,/* base_addr + offset; */ adap_info->pch_data[i].pch_base_address = base_addr +0x100 * i; + pch_adap->dev.of_node = pdev->dev.of_node; pch_adap->dev.parent = &pdev->dev;pch_i2c_init (&adap_info->pch_data[i]);
Signature · 1 line
2.6.2
Wolfram Sang
AppliedRe: [PATCH 15/28] i2c: eg20t: set i2c_adapter->dev.of_node
Quoted 4 lines · Paul Burton
Set the I2C adapter devices
of_nodeto that of the PCI device, such that I2C clients may be instantiated via device tree.Signed-off-by Paul Burton <[email protected]>
Applied to for-next, thanks!
PATCH 16/28 rtc: m41t80: add devicetree probe support
In reply to Paul BurtonAllow the m41t80 RTC driver to be probed via devicetree.
---
drivers/rtc/rtc-m41t80.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
drivers/rtc/rtc-m41t80.c +26 -0
@@ -20,6 +20,7 @@#include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> +#include <linux/of.h> #include <linux/rtc.h> #include <linux/slab.h> #include <linux/mutex.h>
@@ -85,6 +86,14 @@ static const struct i2c_device_id m41t80_id[] = { };MODULE_DEVICE_TABLE (i2c, m41t80_id); +#ifdef CONFIG_OF +static const struct of_device_id m41t80_of_match[] = { + { .compatible ="st,m41t81s" , .name ="m41t81s" }, + { } +}; +MODULE_DEVICE_TABLE (of, m41t80_of_match); +#endif +struct m41t80_data {u8 features;struct rtc_device *rtc;
@@ -637,6 +646,22 @@ static int m41t80_probe(struct i2c_client *client,struct rtc_device *rtc =NULL ;struct rtc_time tm;struct m41t80_data *clientdata =NULL ; +const struct of_device_id *of_id; + +if (!id && client->dev.of_node) { + of_id =of_match_node (of_match_ptr (m41t80_of_match), + client->dev.of_node); +for (id = m41t80_id; id->name[0 ]; id++) { +if (strcmp (of_id->name, id->name) ==0 ) +break ; + } +if (!id->name[0 ]) + id =NULL ; + } +if (!id) { +dev_err (&client->dev,"No i2c_device_id found\n" ); +return -EINVAL ; + }if (!i2c_check_functionality (client->adapter,I2C_FUNC_I2C |I2C_FUNC_SMBUS_BYTE_DATA ))
@@ -728,6 +753,7 @@ static int m41t80_remove(struct i2c_client *client)static struct i2c_driver m41t80_driver = { .driver = { .name ="rtc-m41t80" , + .of_match_table =of_match_ptr (m41t80_of_match), }, .probe = m41t80_probe, .remove = m41t80_remove,
Signature · 12 lines
2.6.2 -- -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
Re: [PATCH 16/28] rtc: m41t80: add devicetree probe support
Hi,
Quoted 2 lines · Paul Burton
Allow the m41t80 RTC driver to be probed via devicetree.
This patch is probably unnecessary as "m41t81s" is already part of m41t80_id[] and will be matched with "st,m41t81s" by the i2c core. See
http://lxr.free-electrons.com/source/drivers/i2c/i2c-core.c#L700
I actually don't know how to get people to stop submitting that kind of patches :)
Signature · 14 lines
Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -- -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
PATCH 17/28 spi: topcliff-pch: allow build for MIPS platforms
In reply to Paul BurtonAllow the topcliff-pch driver to be built for MIPS platforms, in preparation for use on the MIPS Boston board.
---
drivers/spi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/Kconfig +1 -1
@@ -585,7 +585,7 @@ config SPI_TEGRA20_SLINK config SPI_TOPCLIFF_PCH tristate "Intel EG20T PCH/LAPIS Semicon IOH(ML7213/ML7223/ML7831) SPI" - depends on PCI && (X86_32 || COMPILE_TEST) + depends on PCI && (X86_32 || MIPS || COMPILE_TEST) help SPI driver for the Topcliff PCH (Platform Controller Hub) SPI bus used in some x86 embedded processors.
Signature · 1 line
2.6.2
A message that is not in the archive (sent off-list or not yet received): 1448900513-20856-18-git-send-email-paul.burton-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org
Applied "spi: topcliff-pch: allow build for MIPS platforms" to the spi tree
The patch
spi: topcliff-pch: allow build for MIPS platforms
has been applied to the spi tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
f05ca854b3df79bf6596de5102eb99ca10d6089fMon Sep 17 00:00:00 2001
From: Paul Burton <[email protected]>
Date: Mon, 30 Nov 2015 16:21:42 +0000
Subject: [PATCH] spi: topcliff-pch: allow build for MIPS platforms
Allow the topcliff-pch driver to be built for MIPS platforms, in preparation for use on the MIPS Boston board.
--- drivers/spi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/Kconfig +1 -1
@@ -585,7 +585,7 @@ config SPI_TEGRA20_SLINK config SPI_TOPCLIFF_PCH tristate "Intel EG20T PCH/LAPIS Semicon IOH(ML7213/ML7223/ML7831) SPI" - depends on PCI && (X86_32 || COMPILE_TEST) + depends on PCI && (X86_32 || MIPS || COMPILE_TEST) help SPI driver for the Topcliff PCH (Platform Controller Hub) SPI bus used in some x86 embedded processors.
Signature · 6 lines
2.6.2 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 18/28 ptp: pch: allow build on MIPS platforms
In reply to Paul BurtonAllow the ptp_pch driver to be built on MIPS platforms in preparation for use on the MIPS Boston board.
---
drivers/ptp/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ptp/Kconfig +1 -1
@@ -74,7 +74,7 @@ config DP83640_PHY config PTP_1588_CLOCK_PCH tristate "Intel PCH EG20T as PTP clock" - depends on X86_32 || COMPILE_TEST + depends on X86_32 || MIPS || COMPILE_TEST depends on HAS_IOMEM && NET select PTP_1588_CLOCK help
Signature · 1 line
2.6.2
Re: [PATCH 18/28] ptp: pch: allow build on MIPS platforms
Quoted 4 lines · Paul Burton
Allow the
ptp_pchdriver to be built on MIPS platforms in preparation for use on the MIPS Boston board.Signed-off-by Paul Burton <[email protected]>
PATCH 19/28 net: pch_gbe: allow build on MIPS platforms
In reply to Paul BurtonAllow the pch_gbe driver to be built on MIPS platforms, in preparation for its use on the MIPS Boston board.
---
drivers/net/ethernet/oki-semi/pch_gbe/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/oki-semi/pch_gbe/Kconfig +1 -1
@@ -4,7 +4,7 @@ config PCH_GBE tristate "OKI SEMICONDUCTOR IOH(ML7223/ML7831) GbE" - depends on PCI && (X86_32 || COMPILE_TEST) + depends on PCI && (X86_32 || MIPS || COMPILE_TEST) select MII select PTP_1588_CLOCK_PCH select NET_PTP_CLASSIFY
Signature · 1 line
2.6.2
PATCH 20/28 net: pch_gbe: clear interrupt FIFO during probe
In reply to Paul Burtonxilinx_pcie_init_port clears the pending interrupts in the interrupt decode register, but does not clear the interrupt FIFO. This would lead to spurious interrupts if any were present in the FIFO at probe time. Clear the interrupt FIFO prior to the interrupt decode register in order to start with a clean slate as expected.
---
drivers/pci/host/pcie-xilinx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/pci/host/pcie-xilinx.c +13 -0
@@ -566,6 +566,8 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port)*/ static void xilinx_pcie_init_port (struct xilinx_pcie_port *port) { +u32 val; +if (xilinx_pcie_link_is_up (port))dev_info (port->dev,"PCIe Link is UP\n" );else
@@ -575,6 +577,17 @@ static void xilinx_pcie_init_port(struct xilinx_pcie_port *port)pcie_write (port, ~XILINX_PCIE_IDR_ALL_MASK ,XILINX_PCIE_REG_IMR ); +/* Clear interrupt FIFO */ +while (1 ) { + val =pcie_read (port,XILINX_PCIE_REG_RPIFR1 ); + +if (!(val &XILINX_PCIE_RPIFR1_INTR_VALID )) +break ; + +pcie_write (port,XILINX_PCIE_RPIFR1_ALL_MASK , +XILINX_PCIE_REG_RPIFR1 ); + } +/* Clear pending interrupts */ pcie_write(port, pcie_read(port, XILINX_PCIE_REG_IDR) & XILINX_PCIE_IMR_ALL_MASK,
Signature · 1 line
2.6.2
Re: [PATCH 20/28] net: pch_gbe: clear interrupt FIFO during probe
Quoted 7 lines · Paul Burton
xilinx_pcie_init_portclears the pending interrupts in the interrupt decode register, but does not clear the interrupt FIFO. This would lead to spurious interrupts if any were present in the FIFO at probe time. Clear the interrupt FIFO prior to the interrupt decode register in order to start with a clean slate as expected.Signed-off-by Paul Burton <[email protected]>
Seems like the subject should be "PCI: xilinx: ..." to be consistent with the changes you are making to this driver earlier in the series?
Signature · 1 line
Florian
PATCH 21/28 net: pch_gbe: mark Minnow PHY reset GPIO active low
In reply to Paul BurtonThe Minnow PHY reset GPIO is set to 0 to enter reset & 1 to leave reset
- that is, it is an active low GPIO. In order to allow for the code to be made more generic by further patches, indicate to the GPIO subsystem that the GPIO is active low & invert the values it is set to such that they reflect logically whether the device is being reset or not.
---
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +4 -3
@@ -2717,7 +2717,8 @@ err_free_netdev:*/ static int pch_gbe_minnow_platform_init (struct pci_dev *pdev) { -unsigned long flags =GPIOF_DIR_OUT |GPIOF_INIT_HIGH |GPIOF_EXPORT ; +unsigned long flags =GPIOF_DIR_OUT |GPIOF_INIT_LOW | +GPIOF_EXPORT |GPIOF_ACTIVE_LOW ;unsigned gpio =MINNOW_PHY_RESET_GPIO ;int ret;
@@ -2729,10 +2730,10 @@ static int pch_gbe_minnow_platform_init(struct pci_dev *pdev)return ret; } -gpio_set_value (gpio,0 ); -usleep_range (1250 ,1500 );gpio_set_value (gpio,1 );usleep_range (1250 ,1500 ); +gpio_set_value (gpio,0 ); +usleep_range (1250 ,1500 );return ret; }
Signature · 1 line
2.6.2
PATCH 22/28 net: pch_gbe: pull PHY GPIO handling out of Minnow code
In reply to Paul BurtonThe MIPS Boston development board uses the Intel EG20T Platform Controller Hub, including its gigabit ethernet controller, and requires that its RTL8211E PHY be reset much like the Minnow platform. Pull the PHY reset GPIO handling out of Minnow-specific code such that it can be shared by later patches.
---
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h | 4 ++- .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 33 +++++++++++++++------- 2 files changed, 26 insertions(+), 11 deletions(-)
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h +3 -1
@@ -582,15 +582,17 @@ struct pch_gbe_hw_stats {/** * struct pch_gbe_privdata - PCI Device ID driver data +* @phy_reset_gpio: PHY reset GPIO descriptor. * @phy_tx_clk_delay: Bool, configure the PHY TX delay in software * @phy_disable_hibernate: Bool, disable PHY hibernation * @platform_init: Platform initialization callback, called from * probe, prior to PHY initialization. */ struct pch_gbe_privdata { +struct gpio_desc *phy_reset_gpio;bool phy_tx_clk_delay;bool phy_disable_hibernate; -int (*platform_init)(struct pci_dev *pdev); +int (*platform_init)(struct pci_dev *,struct pch_gbe_privdata *); };/**
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +23 -10
@@ -360,6 +360,16 @@ static void pch_gbe_mac_mar_set(struct pch_gbe_hw *hw, u8 * addr, u32 index)pch_gbe_wait_clr_bit (&hw->reg->ADDR_MASK,PCH_GBE_BUSY ); } +static void pch_gbe_phy_set_reset (struct pch_gbe_hw *hw,int value) +{ +struct pch_gbe_adapter *adapter =pch_gbe_hw_to_adapter (hw); + +if (!adapter->pdata || !adapter->pdata->phy_reset_gpio) +return ; + +gpiod_set_value (adapter->pdata->phy_reset_gpio, value); +} +/** * pch_gbe_mac_reset_hw - Reset hardware * @hw: Pointer to the HW structure
@@ -2627,7 +2637,14 @@ static int pch_gbe_probe(struct pci_dev *pdev, adapter->hw.reg =pcim_iomap_table (pdev)[PCH_GBE_PCI_BAR ]; adapter->pdata = (struct pch_gbe_privdata *)pci_id->driver_data;if (adapter->pdata && adapter->pdata->platform_init) - adapter->pdata->platform_init (pdev); + adapter->pdata->platform_init (pdev, pdata); + +if (adapter->pdata && adapter->pdata->phy_reset_gpio) { +pch_gbe_phy_set_reset (&adapter->hw,1 ); +usleep_range (1250 ,1500 ); +pch_gbe_phy_set_reset (&adapter->hw,0 ); +usleep_range (1250 ,1500 ); + } adapter->ptp_pdev =pci_get_bus_and_slot (adapter->pdev->bus->number,PCI_DEVFN (12 ,4 ));
@@ -2715,7 +2732,8 @@ err_free_netdev:/* The AR803X PHY on the MinnowBoard requires a physical pin to be toggled to * ensure it is awake for probe and init. Request the line and reset the PHY. */ -static int pch_gbe_minnow_platform_init (struct pci_dev *pdev) +static int pch_gbe_minnow_platform_init (struct pci_dev *pdev, +struct pch_gbe_privdata *pdata) {unsigned long flags =GPIOF_DIR_OUT |GPIOF_INIT_LOW |GPIOF_EXPORT |GPIOF_ACTIVE_LOW ;
@@ -2724,16 +2742,11 @@ static int pch_gbe_minnow_platform_init(struct pci_dev *pdev) ret =devm_gpio_request_one (&pdev->dev, gpio, flags,"minnow_phy_reset" ); -if (ret) { +if (!ret) + pdata->phy_reset_gpio =gpio_to_desc (gpio); +else dev_err (&pdev->dev,"ERR: Can't request PHY reset GPIO line '%d'\n" , gpio); -return ret; - } - -gpio_set_value (gpio,1 ); -usleep_range (1250 ,1500 ); -gpio_set_value (gpio,0 ); -usleep_range (1250 ,1500 );return ret; }
Signature · 1 line
2.6.2
PATCH 23/28 net: pch_gbe: always reset PHY along with MAC
In reply to Paul BurtonOn the MIPS Boston development board, the EG20T MAC does not report receiving the RX clock from the (RGMII) RTL8211E PHY unless the PHY is reset at the same time as the MAC. Since the pch_gbe driver resets the MAC a number of times - twice during probe, and when taking down the network interface - we need to reset the PHY at all the same times. Do that from pch_gbe_mac_reset_hw which is used to reset the MAC in all cases.
---
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +3 -0
@@ -378,10 +378,13 @@ static void pch_gbe_mac_reset_hw(struct pch_gbe_hw *hw) {/* Read the MAC address. and store to the private data */ pch_gbe_mac_read_mac_addr (hw); +pch_gbe_phy_set_reset (hw,1 );iowrite32 (PCH_GBE_ALL_RST , &hw->reg->RESET);#ifdef PCH_GBE_MAC_IFOP_RGMII iowrite32 (PCH_GBE_MODE_GMII_ETHER , &hw->reg->MODE);#endif +pch_gbe_phy_set_reset (hw,0 ); +usleep_range (1250 ,1500 );pch_gbe_wait_clr_bit (&hw->reg->RESET,PCH_GBE_ALL_RST );/* Setup the receive addresses */ pch_gbe_mac_mar_set (hw, hw->mac.addr,0 );
Signature · 1 line
2.6.2
PATCH 24/28 net: pch_gbe: add device tree support
In reply to Paul BurtonIntroduce support for retrieving the PHY reset GPIO from device tree, which will be used on the MIPS Boston development board. This requires support for probe deferral in order to work correctly, since the order of device probe is not guaranteed & typically the EG20T GPIO controller device will be probed after the ethernet MAC.
---
.../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 33 +++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-)
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +32 -1
@@ -23,6 +23,8 @@#include <linux/net_tstamp.h> #include <linux/ptp_classify.h> #include <linux/gpio.h> +#include <linux/gpio/consumer.h> +#include <linux/of_gpio.h> #define DRV_VERSION "1.01"const char pch_driver_version[] =DRV_VERSION ;
@@ -2594,13 +2596,41 @@ static void pch_gbe_remove(struct pci_dev *pdev)free_netdev (netdev); } +static int pch_gbe_parse_dt (struct pci_dev *pdev, +struct pch_gbe_privdata **pdata) +{ +struct device_node *np = pdev->dev.of_node; +struct gpio_desc *gpio; + +if (!config_enabled (CONFIG_OF ) || !np) +return 0 ; + +if (!*pdata) + *pdata =devm_kzalloc (&pdev->dev,sizeof (**pdata),GFP_KERNEL ); +if (!*pdata) +return -ENOMEM ; + + gpio =devm_gpiod_get (&pdev->dev,"phy-reset" ,GPIOD_ASIS ); +if (IS_ERR (gpio)) +return PTR_ERR (gpio); + + (*pdata)->phy_reset_gpio = gpio; +return 0 ; +} +static int pch_gbe_probe (struct pci_dev *pdev,const struct pci_device_id *pci_id) {struct net_device *netdev;struct pch_gbe_adapter *adapter; +struct pch_gbe_privdata *pdata;int ret; + pdata = (struct pch_gbe_privdata *)pci_id->driver_data; + ret =pch_gbe_parse_dt (pdev, &pdata); +if (ret) + goto err_out; + ret =pcim_enable_device (pdev);if (ret)return ret;
@@ -2638,7 +2668,7 @@ static int pch_gbe_probe(struct pci_dev *pdev, adapter->pdev = pdev; adapter->hw.back = adapter; adapter->hw.reg =pcim_iomap_table (pdev)[PCH_GBE_PCI_BAR ]; - adapter->pdata = (struct pch_gbe_privdata *)pci_id->driver_data; + adapter->pdata = pdata;if (adapter->pdata && adapter->pdata->platform_init) adapter->pdata->platform_init (pdev, pdata);
@@ -2729,6 +2759,7 @@ err_free_adapter:pch_gbe_hal_phy_hw_reset (&adapter->hw); err_free_netdev:free_netdev (netdev); +err_out:return ret; }
Signature · 1 line
2.6.2
Re: [PATCH 24/28] net: pch_gbe: add device tree support
Quoted 26 lines · Paul Burton
Introduce support for retrieving the PHY reset GPIO from device tree, which will be used on the MIPS Boston development board. This requires support for probe deferral in order to work correctly, since the order of device probe is not guaranteed & typically the EG20T GPIO controller device will be probed after the ethernet MAC.
Signed-off-by Paul Burton <[email protected]>---
.../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 33 +++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-)drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +2
-0@@ -23,6 +23,8 @@#include <linux/net_tstamp.h> #include <linux/ptp_classify.h> #include <linux/gpio.h> +#include <linux/gpio/consumer.h> +#include <linux/of_gpio.h> #define DRV_VERSION "1.01"const char pch_driver_version[] =DRV_VERSION ;
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c static void pch_gbe_remove(struct pci_dev *pdev) · line 2600
Quoted 5 lines
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +2
-0@@ -2594,13 +2596,41 @@ static void pch_gbe_remove(struct pci_dev *pdev)free_netdev (netdev); } +static int pch_gbe_parse_dt (struct pci_dev *pdev, +struct pch_gbe_privdata **pdata)
Why not to return pdata as it done in many other drivers? You have ERR_PTR() macro to pass errors.
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c static void pch_gbe_remove(struct pci_dev *pdev) · line 2605
Quoted 5 lines
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +5
-0+{ +struct device_node *np = pdev->dev.of_node; +struct gpio_desc *gpio; + +if (!config_enabled (CONFIG_OF ) || !np)
Before I saw IS_ENABLED(). Is this one a preferable new API?
Quoted 15 lines
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +15
-0+return 0 ; + +if (!*pdata) + *pdata =devm_kzalloc (&pdev->dev,sizeof (**pdata),GFP_KERNEL ); +if (!*pdata) +return -ENOMEM ; + + gpio =devm_gpiod_get (&pdev->dev,"phy-reset" ,GPIOD_ASIS ); +if (IS_ERR (gpio)) +return PTR_ERR (gpio); + + (*pdata)->phy_reset_gpio = gpio; +return 0 ; +} +
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c static void pch_gbe_remove(struct pci_dev *pdev) · line 2630
Quoted 10 lines
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +3
-0static int pch_gbe_probe (struct pci_dev *pdev,const struct pci_device_id *pci_id) {struct net_device *netdev;struct pch_gbe_adapter *adapter; +struct pch_gbe_privdata *pdata;int ret; + pdata = (struct pch_gbe_privdata *)pci_id->driver_data; + ret =pch_gbe_parse_dt (pdev, &pdata);
So, I didn;t see anything related to dt in that function. Maybe you just call it always? In that case remove check for np.
Quoted 16 lines
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +4
-1+if (ret) + goto err_out; + ret =pcim_enable_device (pdev);if (ret)return ret;@@ -2638,7 +2668,7 @@ static int pch_gbe_probe(struct pci_dev *pdev, adapter->pdev = pdev; adapter->hw.back = adapter; adapter->hw.reg =pcim_iomap_table (pdev)[PCH_GBE_PCI_BAR ]; - adapter->pdata = (struct pch_gbe_privdata *)pci_id->driver_data; + adapter->pdata = pdata;if (adapter->pdata && adapter->pdata->platform_init) adapter->pdata->platform_init (pdev, pdata);
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c err_free_adapter: · line 2762
Quoted 4 lines
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +1
-0@@ -2729,6 +2759,7 @@ err_free_adapter:pch_gbe_hal_phy_hw_reset (&adapter->hw); err_free_netdev:free_netdev (netdev); +err_out:
Redundant.
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c err_free_adapter: · line 2764
Quoted 2 lines
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +0
-0return ret; }
For now it's a common practice to mix styles in probe due to usage of devres API.
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 25/28 net: pch_gbe: allow longer for resets
In reply to Paul BurtonResets of the EG20T MAC on the MIPS Boston development board take longer than the 1000 loops that pch_gbe_wait_clr_bit was performing. Bump up the number of loops.
---
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +1 -1
@@ -321,7 +321,7 @@ static void pch_gbe_wait_clr_bit(void *reg, u32 bit)u32 tmp;/* wait busy */ - tmp =1000 ; + tmp =10000 ;while ((ioread32 (reg) & bit) && --tmp)cpu_relax ();if (!tmp)
Signature · 1 line
2.6.2
PATCH 26/28 MIPS: support for generating FIT (.itb) images
In reply to Paul BurtonIntroduce support for generating Flattened Image Tree images containing the kernel & platform-specific configuration such as a device tree binary. The FIT format is supported by U-Boot and has a number of advantages over the older legacy uImage format:
- It includes device tree binaries inside the image without embedding them directly into the kernel ELF, allowing the bootloader to easily find & manipulate the DTB whilst still only requiring a single file to be loaded during boot or distributed to users.
- It allows for an arbitrary number of images & configurations to be included in a single file. Once the code for various systems built around the MIPS Coherent Processing System architecture (ie. Imagination Technologies MIPS cores with optional CM, GIC & CPC) is consolidated sufficiently this will allow for a single binary to include multiple device trees & boot on multiple boards.
- It allows for a choice of hash algorithms to verify the contents of the image.
- It allows for cryptographically signed images should that ever be desired.
---
arch/mips/Makefile | 6 ++++- arch/mips/boot/Makefile | 61 +++++++++++++++++++++++++++++++++++++++++++++ arch/mips/boot/skeleton.its | 24 ++++++++++++++++++ 3 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 arch/mips/boot/skeleton.its
arch/mips/Makefile +5 -1
@@ -267,7 +267,8 @@ KBUILD_CPPFLAGS += -DVMLINUX_LOAD_ADDRESS=$(load-y) KBUILD_CPPFLAGS += -DDATAOFFSET=$(if $(dataoffset-y),$(dataoffset-y),0) bootvars-y = VMLINUX_LOAD_ADDRESS=$(load-y) \ - VMLINUX_ENTRY_ADDRESS=$(entry-y) + VMLINUX_ENTRY_ADDRESS=$(entry-y) \ + PLATFORM_ITS=$(its-y) LDFLAGS += -m $(ld-emul)
@@ -307,6 +308,9 @@ boot-y += uImage.gz boot-y += uImage.lzma boot-y += uImage.lzo endif +boot-y += vmlinux.itb +boot-y += vmlinux.bz2.itb +boot-y += vmlinux.gz.itb # compressed boot image targets (arch/mips/boot/compressed/) bootz-y := vmlinuz
arch/mips/boot/Makefile +61 -0
64 lines not on this page · raw message
arch/mips/boot/skeleton.its new file +24 -0
@@ -0,0 +1,24 @@ +/dts-v1/; + +/ { + description = "MIPS Linux"; + #address-cells = <1>; + + images { + kernel@0 { + description = "Linux"; + data = /incbin/("__VMLINUX__"); + type = "kernel"; + arch = "mips"; + os = "linux"; + compression = "__VMLINUX_COMPRESSION__"; + load = <__LOAD_ADDR__>; + entry = <__ENTRY_ADDR__>; + hash@1 { + algo = "sha1"; + }; + }; + }; +}; + +__PLATFORM_INCLUDES__
Signature · 1 line
2.6.2
PATCH 27/28 dt-bindings: mips: img,boston: Document img,boston binding
In reply to Paul BurtonAdd documentation for the simple img,boston devicetree binding & the boot protocol used to pass the devicetree to the kernel.
---
Documentation/devicetree/bindings/mips/img/boston.txt | 15 +++++++++++++++ MAINTAINERS | 5 +++++ 2 files changed, 20 insertions(+) create mode 100644 Documentation/devicetree/bindings/mips/img/boston.txt
Documentation/devicetree/bindings/mips/img/boston.txt new file +15 -0
@@ -0,0 +1,15 @@ +Imagination Technologies Boston Development Board +================================================= + +Required properties: +-------------------- + - compatible: Must be "img,boston". + +Boot protocol: +-------------- +In accordance with the MIPS UHI specification[1], the bootloader must pass the +following arguments to the kernel: + - $a0: -2. + - $a1: KSEG0 address of the flattened device-tree blob. + +[1] http://prplfoundation.org/wiki/MIPS_documentation
MAINTAINERS +5 -0
@@ -5435,6 +5435,11 @@ L: [email protected] S: Supported F: security/integrity/ima/ +IMGTEC BOSTON PLATFORM SUPPORT +M: Paul Burton <[email protected]> +S: Maintained +F: Documentation/devicetree/bindings/mips/img/boston.txt + IMGTEC IR DECODER DRIVER M: James Hogan <[email protected]> S: Maintained
Signature · 1 line
2.6.2
Rob Herring
maintainerRe: [PATCH 27/28] dt-bindings: mips: img,boston: Document img,boston binding
Quoted 17 lines · Paul Burton
Add documentation for the simple img,boston devicetree binding & the boot protocol used to pass the devicetree to the kernel.
Signed-off-by Paul Burton <[email protected]>---
Documentation/devicetree/bindings/mips/img/boston.txt | 15 +++++++++++++++ MAINTAINERS | 5 +++++ 2 files changed, 20 insertions(+) create mode 100644 Documentation/devicetree/bindings/mips/img/boston.txtDocumentation/devicetree/bindings/mips/img/boston.txt new file +0
-0
Documentation/devicetree/bindings/mips/img/boston.txt line 6
Quoted 6 lines
Documentation/devicetree/bindings/mips/img/boston.txt new file +6
-0@@ -0,0 +1,15 @@ +Imagination Technologies Boston Development Board +================================================= + +Required properties: +-------------------- + - compatible: Must be "img,boston".
No SOC compatible in addition?
Documentation/devicetree/bindings/mips/img/boston.txt line 13
Quoted 7 lines
Documentation/devicetree/bindings/mips/img/boston.txt new file +7
-0+ +Boot protocol: +-------------- +In accordance with the MIPS UHI specification[1], the bootloader must pass the +following arguments to the kernel: + - $a0: -2. + - $a1: KSEG0 address of the flattened device-tree blob.
If this is standard, I don't know that we need to repeat it for every board.
Rob
Quoted 2 lines
Documentation/devicetree/bindings/mips/img/boston.txt new file +2
-0+ +[1] http://prplfoundation.org/wiki/MIPS_documentation
PATCH 28/28 MIPS: Boston board support
In reply to Paul BurtonAdd support for the MIPS Boston development board. Boston is an FPGA-based development board akin to the much older Malta board. As such it's very configurable, but in broad terms it's built around a Xilinx FPGA running a MIPS core & other logic, and 3 Xilinx PCIe root ports - one of which is connected to an Intel EG20T Platform Controller Hub to provide a base set of peripherals.
---
MAINTAINERS | 3 + arch/mips/Kbuild.platforms | 1 + arch/mips/Kconfig | 39 ++++ arch/mips/boot/dts/Makefile | 1 + arch/mips/boot/dts/img/Makefile | 7 + arch/mips/boot/dts/img/boston.dts | 201 +++++++++++++++++++++ arch/mips/boston/Makefile | 12 ++ arch/mips/boston/Platform | 8 + arch/mips/boston/init.c | 75 ++++++++ arch/mips/boston/int.c | 33 ++++ arch/mips/boston/time.c | 89 +++++++++ arch/mips/boston/vmlinux.its | 23 +++ arch/mips/configs/boston_defconfig | 170 +++++++++++++++++ .../asm/mach-boston/cpu-feature-overrides.h | 26 +++ arch/mips/include/asm/mach-boston/irq.h | 18 ++ arch/mips/include/asm/mach-boston/spaces.h | 20 ++ 16 files changed, 726 insertions(+) create mode 100644 arch/mips/boot/dts/img/Makefile create mode 100644 arch/mips/boot/dts/img/boston.dts create mode 100644 arch/mips/boston/Makefile create mode 100644 arch/mips/boston/Platform create mode 100644 arch/mips/boston/init.c create mode 100644 arch/mips/boston/int.c create mode 100644 arch/mips/boston/time.c create mode 100644 arch/mips/boston/vmlinux.its create mode 100644 arch/mips/configs/boston_defconfig create mode 100644 arch/mips/include/asm/mach-boston/cpu-feature-overrides.h create mode 100644 arch/mips/include/asm/mach-boston/irq.h create mode 100644 arch/mips/include/asm/mach-boston/spaces.h
MAINTAINERS +3 -0
@@ -5438,6 +5438,9 @@ F: security/integrity/ima/ IMGTEC BOSTON PLATFORM SUPPORT M: Paul Burton <[email protected]> S: Maintained +F: arch/mips/boot/dts/img/boston.dts +F: arch/mips/boston/ +F: arch/mips/include/asm/mach-boston/ F: Documentation/devicetree/bindings/mips/img/boston.txt IMGTEC IR DECODER DRIVER
arch/mips/Kbuild.platforms +1 -0
@@ -7,6 +7,7 @@ platforms += ath79 platforms += bcm47xx platforms += bcm63xx platforms += bmips +platforms += boston platforms += cavium-octeon platforms += cobalt platforms += dec
arch/mips/Kconfig +39 -0
@@ -216,6 +216,45 @@ config BCM63XX help Support for BCM63XX based boards +config BOSTON + bool "MIPS Boston board" + select ARCH_REQUIRE_GPIOLIB + select BOOT_ELF32 + select BOOT_RAW + select BUILTIN_DTB + select CEVT_R4K + select COMMON_CLK + select CSRC_R4K + select DMA_NONCOHERENT + select HW_HAS_PCI + select IRQ_MIPS_CPU + select MIPS_CPU_SCACHE + select MIPS_GENERIC_PCI + select MIPS_GIC + select MIPS_L1_CACHE_SHIFT_6 + select SYS_HAS_CPU_MIPS32_R1 + select SYS_HAS_CPU_MIPS32_R2 + select SYS_HAS_CPU_MIPS32_R3_5 + select SYS_HAS_CPU_MIPS32_R5 + select SYS_HAS_CPU_MIPS32_R6 + select SYS_HAS_CPU_MIPS64_R1 + select SYS_HAS_CPU_MIPS64_R2 + select SYS_HAS_CPU_MIPS64_R6 + select SYS_SUPPORTS_32BIT_KERNEL + select SYS_SUPPORTS_64BIT_KERNEL + select SYS_SUPPORTS_BIG_ENDIAN + select SYS_SUPPORTS_HIGHMEM + select SYS_SUPPORTS_LITTLE_ENDIAN + select SYS_SUPPORTS_MIPS_CPS + select SYS_SUPPORTS_MULTITHREADING + select SYS_SUPPORTS_ZBOOT + select USE_OF + help + This enables support for the MIPS Boston development board from + Imagination Technologies. Boston is an FPGA-based development + board aimed at evaluating MIPS CPUs & developing software for + them. If you wish to build for such a board, select this. + config MIPS_COBALT bool "Cobalt Server" select CEVT_R4K
arch/mips/boot/dts/Makefile +1 -0
@@ -1,5 +1,6 @@ dts-dirs += brcm dts-dirs += cavium-octeon +dts-dirs += img dts-dirs += ingenic dts-dirs += lantiq dts-dirs += mti
arch/mips/boot/dts/img/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +dtb-$(CONFIG_BOSTON) += boston.dtb + +# Force kbuild to make empty built-in.o if necessary +obj- += dummy.o + +always := $(dtb-y) +clean-files := *.dtb *.dtb.S
arch/mips/boot/dts/img/boston.dts new file +201 -0
201 lines not on this page · raw message
arch/mips/boston/Makefile new file +12 -0
@@ -0,0 +1,12 @@ +# +# Copyright (C) 2015 Imagination Technologies +# Author: Paul Burton <[email protected]> +# +# 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. +# +obj-y += init.o +obj-y += int.o +obj-y += time.o
arch/mips/boston/Platform new file +8 -0
@@ -0,0 +1,8 @@ +# +# MIPS Boston board +# +platform-$(CONFIG_BOSTON) += boston/ +cflags-$(CONFIG_BOSTON) += -I$(srctree)/arch/mips/include/asm/mach-boston +load-$(CONFIG_BOSTON) += 0xffffffff80100000 +all-$(CONFIG_BOSTON) := $(COMPRESSION_FNAME).bin +its-$(CONFIG_BOSTON) += boston/vmlinux.its
arch/mips/boston/init.c new file +75 -0
75 lines not on this page · raw message
arch/mips/boston/int.c new file +33 -0
@@ -0,0 +1,33 @@ +/* +* Copyright (C) 2015 Imagination Technologies +* Author: Paul Burton <[email protected]> +* +* 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. +*/ + +#include <linux/init.h> +#include <linux/irqchip.h> +#include <linux/of_irq.h> + +#include <asm/irq_cpu.h> +#include <asm/mips-cm.h> +#include <asm/traps.h> + +static int be_handler (struct pt_regs *regs,int is_fixup) +{ +mips_cm_error_report (); +return is_fixup ?MIPS_BE_FIXUP :MIPS_BE_FATAL ; +} + +void __init arch_init_irq (void ) +{ + board_be_handler = be_handler; + +if (!cpu_has_veic) +mips_cpu_irq_init (); + +irqchip_init (); +}
arch/mips/boston/time.c new file +89 -0
89 lines not on this page · raw message
arch/mips/boston/vmlinux.its new file +23 -0
@@ -0,0 +1,23 @@ +/ { + images { + fdt@boston { + description = "img,boston Device Tree"; + data = /incbin/("boot/dts/img/boston.dtb"); + type = "flat_dt"; + arch = "mips"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + }; + + configurations { + default = "conf@boston"; + conf@boston { + description = "Boot Linux kernel"; + kernel = "kernel@0"; + fdt = "fdt@boston"; + }; + }; +};
arch/mips/configs/boston_defconfig new file +170 -0
170 lines not on this page · raw message
arch/mips/include/asm/mach-boston/cpu-feature-overrides.h new file +26 -0
@@ -0,0 +1,26 @@ +/* +* Copyright (C) 2015 Imagination Technologies +* Author: Paul Burton <[email protected]> +* +* 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. +*/ + +#ifndef __ASM_MACH_BOSTON_CPU_FEATURE_OVERRIDES_H__ +#define __ASM_MACH_BOSTON_CPU_FEATURE_OVERRIDES_H__ + +#define cpu_has_4kex 1 +#define cpu_has_4k_cache 1 +#define cpu_has_clo_clz 1 +#define cpu_has_counter 1 +#define cpu_has_divec 1 +#define cpu_has_llsc 1 +#define cpu_has_mcheck 1 +#define cpu_has_nofpuex 0 +#define cpu_has_tlb 1 +#define cpu_has_vce 0 +#define cpu_icache_snoops_remote_store 1 + +#endif /* __ASM_MACH_BOSTON_CPU_FEATURE_OVERRIDES_H__ */
arch/mips/include/asm/mach-boston/irq.h new file +18 -0
@@ -0,0 +1,18 @@ +/* +* Copyright (C) 2015 Imagination Technologies +* Author: Paul Burton <[email protected]> +* +* 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. +*/ + +#ifndef __ASM_MACH_BOSTON_IRQ_H__ +#define __ASM_MACH_BOSTON_IRQ_H__ + +#define NR_IRQS 256 + +#include_next <irq.h> + +#endif /* __ASM_MACH_BOSTON_IRQ_H__ */
arch/mips/include/asm/mach-boston/spaces.h new file +20 -0
@@ -0,0 +1,20 @@ +/* +* Copyright (C) 2015 Imagination Technologies +* Author: Paul Burton <[email protected]> +* +* 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. +*/ + +#ifndef __ASM_MACH_BOSTON_SPACES_H__ +#define __ASM_MACH_BOSTON_SPACES_H__ + +#ifdef CONFIG_64BIT +# define CAC_BASE _AC(0xa800000000000000, UL) +#endif + +#include <asm/mach-generic/spaces.h> + +#endif /* __ASM_MACH_BOSTON_SPACES_H__ */
Signature · 1 line
2.6.2
Mark Brown
maintainerQuoted 7 lines · Paul Burton
This series introduces support for the Imagination Technologies MIPS Boston development board. Boston is an FPGA-based development board akin to the much older Malta board, built around a Xilinx FPGA running a MIPS CPU & other logic including a PCIe root port connected to an Intel EG20T Platform Controller Hub. This provides a base set of peripherals including SATA, USB, SD/MMC, ethernet, I2C & GPIOs. PCIe slots are also present for expansion.
This is an insanely big CC list :(
What are the interdependencies here - does this really need to be one patch series or can the individual driver changes go in separately? The latter is more normal, usually rather than a single patch series we just have each driver sent by itself since that's usually easier to handle and avoids the massive CC lists.
Quoted 9 lines · Mark Brown
Quoted 7 lines · Paul Burton
This series introduces support for the Imagination Technologies MIPS Boston development board. Boston is an FPGA-based development board akin to the much older Malta board, built around a Xilinx FPGA running a MIPS CPU & other logic including a PCIe root port connected to an Intel EG20T Platform Controller Hub. This provides a base set of peripherals including SATA, USB, SD/MMC, ethernet, I2C & GPIOs. PCIe slots are also present for expansion.
Quoted 4 lines
This is an insanely big CC list :(
What are the interdependencies here - does this really need to be one patch series or can the individual driver changes go in separately?
I took the two GPIO patches and ran off with them at least.
Yours,
Linus Walleij