Adding devices support for all spear machines
Subsystems (2)
v6 cover Adding devices support for all spear machines
This patchset adds device drivers and their machine support for all SPEAr Families.
Note: These patches were earlier sent as part of a larger patchset:
"Updating SPEAr Support"
Now it is divided into smaller patchsets. In order to apply these patches cleanly following order of patchsets must be maintained.
- SPEAr3xx & SPEAr6xx Fixes
- SPEAr3xx & SPEAr6xx: Single Image solution and padmux updates
- Adding SPEAr13xx support
- Adding devices support for all spear machines
- Clock Framework & CPU Freq Updates
Deepak Sikri (2):
ST SPEAr: Adding machine support for USB host
ST SPEAr Power Management: Added the support for Standby mode.
Pratyush Anand (1):
ST SPEAr13xx: Added PCIe host controller base driver support.
Rajeev Kumar (3):
ST SPEAr: Adding machine support for rtc-spear ST SPEAr: adding support for synopsis i2c designware ST SPEAr: Adding machine support for keyboard
Vipin Kumar (2):
ST SPEAr3xx: EMI (External Memory Interface) controller driver ST SPEAr: Adding machine support for nand
Viresh Kumar (9):
ST SPEAr13xx: Added ARM PL061 GPIO Support
ST SPEAr: Adding PLGPIO driver for spear platform
ST SPEAr3xx: Adding support for ST's PWM IP
ST SPEAr: Adding Watchdog support on spear3xx & spear6xx machines ST SPEAr3xx: Adding RAS uart devices
ST SPEAr320: Adding support for CAN
ST SPEAr: Adding support for SSP PL022
ST SPEAr: Adding support for SDHCI (SDIO)
ST SPEAr: Updating defconfigs
arch/arm/Kconfig | 1 + arch/arm/configs/spear13xx_defconfig | 78 ++- arch/arm/configs/spear3xx_defconfig | 80 ++- arch/arm/configs/spear6xx_defconfig | 72 ++- arch/arm/mach-spear13xx/Makefile | 2 + arch/arm/mach-spear13xx/include/mach/generic.h | 15 + arch/arm/mach-spear13xx/include/mach/gpio.h | 18 + arch/arm/mach-spear13xx/include/mach/hardware.h | 7 + arch/arm/mach-spear13xx/include/mach/irqs.h | 27 +- arch/arm/mach-spear13xx/include/mach/pcie.h | 170 +++++ arch/arm/mach-spear13xx/include/mach/suspend.h | 47 ++ arch/arm/mach-spear13xx/pcie.c | 861 +++++++++++++++++++++++ arch/arm/mach-spear13xx/pm.c | 107 +++ arch/arm/mach-spear13xx/sleep.S | 435 ++++++++++++ arch/arm/mach-spear13xx/spear1300_evb.c | 90 +++ arch/arm/mach-spear13xx/spear1310.c | 22 + arch/arm/mach-spear13xx/spear1310_evb.c | 91 +++ arch/arm/mach-spear13xx/spear13xx.c | 355 ++++++++++ arch/arm/mach-spear3xx/Makefile | 4 + arch/arm/mach-spear3xx/emi.c | 98 +++ arch/arm/mach-spear3xx/include/mach/emi.h | 61 ++ arch/arm/mach-spear3xx/include/mach/generic.h | 35 + arch/arm/mach-spear3xx/include/mach/gpio.h | 143 ++++ arch/arm/mach-spear3xx/include/mach/spear310.h | 9 + arch/arm/mach-spear3xx/include/mach/spear320.h | 6 + arch/arm/mach-spear3xx/include/mach/suspend.h | 44 ++ arch/arm/mach-spear3xx/spear300.c | 146 ++++ arch/arm/mach-spear3xx/spear300_evb.c | 85 +++ arch/arm/mach-spear3xx/spear310.c | 155 ++++ arch/arm/mach-spear3xx/spear310_evb.c | 102 +++ arch/arm/mach-spear3xx/spear320.c | 216 ++++++ arch/arm/mach-spear3xx/spear320_evb.c | 92 +++ arch/arm/mach-spear3xx/spear3xx.c | 168 +++++- arch/arm/mach-spear6xx/include/mach/generic.h | 10 + arch/arm/mach-spear6xx/include/mach/gpio.h | 27 + arch/arm/mach-spear6xx/include/mach/suspend.h | 44 ++ arch/arm/mach-spear6xx/spear600_evb.c | 37 + arch/arm/mach-spear6xx/spear6xx.c | 260 +++++++- arch/arm/plat-spear/Kconfig | 9 + arch/arm/plat-spear/Makefile | 17 + arch/arm/plat-spear/i2c_eval_board.c | 29 + arch/arm/plat-spear/include/plat/gpio.h | 35 + arch/arm/plat-spear/include/plat/keyboard.h | 7 - arch/arm/plat-spear/include/plat/spi.h | 74 ++ arch/arm/plat-spear/plgpio.c | 473 +++++++++++++ arch/arm/plat-spear/pm.c | 104 +++ arch/arm/plat-spear/pwm.c | 484 +++++++++++++ arch/arm/plat-spear/sleep.S | 288 ++++++++ 48 files changed, 5711 insertions(+), 29 deletions(-) create mode 100644 arch/arm/mach-spear13xx/include/mach/pcie.h create mode 100644 arch/arm/mach-spear13xx/include/mach/suspend.h create mode 100644 arch/arm/mach-spear13xx/pcie.c create mode 100644 arch/arm/mach-spear13xx/pm.c create mode 100644 arch/arm/mach-spear13xx/sleep.S create mode 100644 arch/arm/mach-spear3xx/emi.c create mode 100644 arch/arm/mach-spear3xx/include/mach/emi.h create mode 100644 arch/arm/mach-spear3xx/include/mach/suspend.h create mode 100644 arch/arm/mach-spear6xx/include/mach/suspend.h create mode 100644 arch/arm/plat-spear/i2c_eval_board.c create mode 100644 arch/arm/plat-spear/include/plat/spi.h create mode 100644 arch/arm/plat-spear/plgpio.c create mode 100644 arch/arm/plat-spear/pm.c create mode 100644 arch/arm/plat-spear/pwm.c create mode 100644 arch/arm/plat-spear/sleep.S
Signature · 1 line
1.7.2.2
PATCH v6 1/17 ST SPEAr13xx: Added ARM PL061 GPIO Support
--- arch/arm/mach-spear13xx/include/mach/generic.h | 1 + arch/arm/mach-spear13xx/include/mach/gpio.h | 18 +++++++++++ arch/arm/mach-spear13xx/include/mach/irqs.h | 10 +++++- arch/arm/mach-spear13xx/spear1300_evb.c | 2 + arch/arm/mach-spear13xx/spear1310_evb.c | 2 + arch/arm/mach-spear13xx/spear13xx.c | 38 ++++++++++++++++++++++++ 6 files changed, 70 insertions(+), 1 deletions(-)
arch/arm/mach-spear13xx/include/mach/generic.h +1 -0
@@ -221,6 +221,7 @@ extern struct pmx_dev pmx_uart1_modem;#define SPEAR_GPT0_CHAN1_IRQ IRQ_GPT0_TMR1/* Add spear13xx family device structure declarations here */ +extern struct amba_device spear13xx_gpio_device[];extern struct amba_device spear13xx_uart_device;extern struct sys_timer spear13xx_timer;
arch/arm/mach-spear13xx/include/mach/gpio.h +18 -0
@@ -16,4 +16,22 @@#include <plat/gpio.h> +#define GPIO0_0 0 +#define GPIO0_1 1 +#define GPIO0_2 2 +#define GPIO0_3 3 +#define GPIO0_4 4 +#define GPIO0_5 5 +#define GPIO0_6 6 +#define GPIO0_7 7 + +#define GPIO1_0 8 +#define GPIO1_1 9 +#define GPIO1_2 10 +#define GPIO1_3 11 +#define GPIO1_4 12 +#define GPIO1_5 13 +#define GPIO1_6 14 +#define GPIO1_7 15 +#endif /* __MACH_GPIO_H */
arch/arm/mach-spear13xx/include/mach/irqs.h +9 -1
@@ -123,6 +123,14 @@#define IRQ_GIC_END (IRQ_SHPI_START + 128) -#define NR_IRQS IRQ_GIC_END +#define VIRQ_START IRQ_GIC_END + +/* GPIO pins virtual irqs */ +#define SPEAR_GPIO0_INT_BASE (VIRQ_START + 0) +#define SPEAR_GPIO1_INT_BASE (SPEAR_GPIO0_INT_BASE + 8) +#define SPEAR_GPIO_INT_END (SPEAR_GPIO1_INT_BASE + 8) + +#define VIRQ_END SPEAR_GPIO_INT_END +#define NR_IRQS VIRQ_END#endif /* __MACH_IRQS_H */
arch/arm/mach-spear13xx/spear1300_evb.c +2 -0
@@ -37,6 +37,8 @@ static struct pmx_dev *pmx_devs[] = { };static struct amba_device *amba_devs[]__initdata = { + &spear13xx_gpio_device[0 ], + &spear13xx_gpio_device[1 ], &spear13xx_uart_device, };
arch/arm/mach-spear13xx/spear1310_evb.c +2 -0
@@ -44,6 +44,8 @@ static struct pmx_dev *pmx_devs[] = {static struct amba_device *amba_devs[]__initdata = {/* spear13xx specific devices */ + &spear13xx_gpio_device[0 ], + &spear13xx_gpio_device[1 ], &spear13xx_uart_device,/* spear1310 specific devices */
arch/arm/mach-spear13xx/spear13xx.c +38 -0
@@ -12,6 +12,7 @@*/ #include <linux/types.h> +#include <linux/amba/pl061.h> #include <linux/ptrace.h> #include <linux/io.h> #include <asm/hardware/gic.h>
@@ -25,6 +26,43 @@#include <mach/irqs.h> /* Add spear13xx machines common devices here */ +/* gpio device registeration */ +static struct pl061_platform_data gpio_plat_data[] = { + { + .gpio_base =0 , + .irq_base =SPEAR_GPIO0_INT_BASE , + }, { + .gpio_base =8 , + .irq_base =SPEAR_GPIO1_INT_BASE , + }, +}; + +struct amba_device spear13xx_gpio_device[] = { + { + .dev = { + .init_name ="gpio0" , + .platform_data = &gpio_plat_data[0 ], + }, + .res = { + .start =SPEAR13XX_GPIO0_BASE , + .end =SPEAR13XX_GPIO0_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, + .irq = {IRQ_GPIO0 ,NO_IRQ }, + }, { + .dev = { + .init_name ="gpio1" , + .platform_data = &gpio_plat_data[1 ], + }, + .res = { + .start =SPEAR13XX_GPIO1_BASE , + .end =SPEAR13XX_GPIO1_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, + .irq = {IRQ_GPIO1 ,NO_IRQ }, + } +}; +/* uart device registeration */ struct amba_device spear13xx_uart_device = { .dev = {
Signature · 1 line
1.7.2.2
PATCH v6 2/17 ST SPEAr13xx: Added PCIe host controller base driver support.
In reply to Viresh KumarFrom: Pratyush Anand <[email protected]>
SPEAr13xx family contains Synopsys designware PCIe version 3.30a. This patch adds support for this PCIe module for spear platform.
--- arch/arm/Kconfig | 1 + arch/arm/mach-spear13xx/Makefile | 1 + arch/arm/mach-spear13xx/include/mach/hardware.h | 7 + arch/arm/mach-spear13xx/include/mach/irqs.h | 19 +- arch/arm/mach-spear13xx/include/mach/pcie.h | 170 +++++ arch/arm/mach-spear13xx/pcie.c | 861 +++++++++++++++++++++++ arch/arm/mach-spear13xx/spear1300_evb.c | 31 + arch/arm/mach-spear13xx/spear1310_evb.c | 31 + arch/arm/mach-spear13xx/spear13xx.c | 28 + arch/arm/plat-spear/Kconfig | 2 + 10 files changed, 1150 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-spear13xx/include/mach/pcie.h create mode 100644 arch/arm/mach-spear13xx/pcie.c
arch/arm/Kconfig +1 -0
@@ -1263,6 +1263,7 @@ config PCI_HOST_ITE8152 select DMABOUNCE source "drivers/pci/Kconfig" +source "drivers/pci/pcie/Kconfig" source "drivers/pcmcia/Kconfig"
arch/arm/mach-spear13xx/Makefile +1 -0
@@ -7,6 +7,7 @@ obj-y += spear13xx.o clock.o obj-$(CONFIG_SMP) += platsmp.o headsmp.o obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o +obj-$(CONFIG_PCIEPORTBUS) += pcie.o # spear1300 specific files obj-$(CONFIG_MACH_SPEAR1300) += spear1300.o
arch/arm/mach-spear13xx/include/mach/hardware.h +7 -0
@@ -28,4 +28,11 @@/* typesafe io address */ #define __io_address (n) __io(IO_ADDRESS(n)) +#if defined(CONFIG_PCI ) +#define PCIBIOS_MIN_IO 0 +#define PCIBIOS_MIN_MEM 0 +#define pcibios_assign_all_busses () 0 +#endif + +#endif /* __MACH_HARDWARE_H */
arch/arm/mach-spear13xx/include/mach/irqs.h +18 -1
@@ -130,7 +130,24 @@#define SPEAR_GPIO1_INT_BASE (SPEAR_GPIO0_INT_BASE + 8)#define SPEAR_GPIO_INT_END (SPEAR_GPIO1_INT_BASE + 8) -#define VIRQ_END SPEAR_GPIO_INT_END +/* PCIE MSI virtual irqs */ +#define SPEAR_NUM_MSI_IRQS 64 +#define SPEAR_MSI0_INT_BASE (SPEAR_GPIO_INT_END + 0) +#define SPEAR_MSI0_INT_END (SPEAR_MSI0_INT_BASE + SPEAR_NUM_MSI_IRQS) +#define SPEAR_MSI1_INT_BASE (SPEAR_MSI0_INT_END + 0) +#define SPEAR_MSI1_INT_END (SPEAR_MSI1_INT_BASE + SPEAR_NUM_MSI_IRQS) +#define SPEAR_MSI2_INT_BASE (SPEAR_MSI1_INT_END + 0) +#define SPEAR_MSI2_INT_END (SPEAR_MSI2_INT_BASE + SPEAR_NUM_MSI_IRQS) + +#define SPEAR_NUM_INTX_IRQS 4 +#define SPEAR_INTX0_BASE (SPEAR_MSI2_INT_END + 0) +#define SPEAR_INTX0_END (SPEAR_INTX0_BASE + SPEAR_NUM_INTX_IRQS) +#define SPEAR_INTX1_BASE (SPEAR_INTX0_END + 0) +#define SPEAR_INTX1_END (SPEAR_INTX1_BASE + SPEAR_NUM_INTX_IRQS) +#define SPEAR_INTX2_BASE (SPEAR_INTX1_END + 0) +#define SPEAR_INTX2_END (SPEAR_INTX2_BASE + SPEAR_NUM_INTX_IRQS) + +#define VIRQ_END SPEAR_INTX2_END#define NR_IRQS VIRQ_END#endif /* __MACH_IRQS_H */
arch/arm/mach-spear13xx/include/mach/pcie.h new file +170 -0
170 lines not on this page · raw message
arch/arm/mach-spear13xx/pcie.c new file +861 -0
861 lines not on this page · raw message
arch/arm/mach-spear13xx/spear1300_evb.c +31 -0
@@ -16,6 +16,7 @@#include <asm/mach-types.h> #include <mach/generic.h> #include <mach/hardware.h> +#include <mach/pcie.h> /* padmux devices to enable */ static struct pmx_dev *pmx_devs[] = {
@@ -45,6 +46,30 @@ static struct amba_device *amba_devs[] __initdata = {static struct platform_device *plat_devs[]__initdata = { }; +#ifdef CONFIG_PCIEPORTBUS +/* +* This function is needed for PCIE host and device driver. Same +* controller can not be programmed as host as well as device. So host +* driver must call this function and if this function returns 1 then +* only host should add that particular port as RC. +* A port to be added as device, one must also add device's information +* in plat_devs array defined in this file. +*/ +static int spear1300_pcie_port_is_host (int port) +{ +switch (port) { +case 0 : +return 0 ; +case 1 : +return 1 ; +case 2 : +return 1 ; + } + +return -EINVAL ; +} +#endif +static void __init spear1300_evb_init (void ) {unsigned int i;
@@ -52,6 +77,12 @@ static void __init spear1300_evb_init(void)/* call spear1300 machine init function */ spear1300_init (NULL , pmx_devs,ARRAY_SIZE (pmx_devs)); +#ifdef CONFIG_PCIEPORTBUS +/* Enable PCIE0 clk */ +enable_pcie0_clk (); +pcie_init (spear1300_pcie_port_is_host); +#endif +/* Add Platform Devices */ platform_add_devices (plat_devs,ARRAY_SIZE (plat_devs));
arch/arm/mach-spear13xx/spear1310_evb.c +31 -0
@@ -16,6 +16,7 @@#include <asm/mach-types.h> #include <mach/generic.h> #include <mach/hardware.h> +#include <mach/pcie.h> /* padmux devices to enable */ static struct pmx_dev *pmx_devs[] = {
@@ -64,6 +65,30 @@ static struct platform_device *plat_devs[] __initdata = { &spear1310_can1_device, }; +#ifdef CONFIG_PCIEPORTBUS +/* +* This function is needed for PCIE host and device driver. Same +* controller can not be programmed as host as well as device. So host +* driver must call this function and if this function returns 1 then +* only host should add that particular port as RC. +* A port to be added as device, one must also add device's information +* in plat_devs array defined in this file. +*/ +static int spear1310_pcie_port_is_host (int port) +{ +switch (port) { +case 0 : +return 0 ; +case 1 : +return 1 ; +case 2 : +return 1 ; + } + +return -EINVAL ; +} +#endif +static void __init spear1310_evb_init (void ) {unsigned int i;
@@ -71,6 +96,12 @@ static void __init spear1310_evb_init(void)/* call spear1310 machine init function */ spear1310_init (NULL , pmx_devs,ARRAY_SIZE (pmx_devs)); +#ifdef CONFIG_PCIEPORTBUS +/* Enable PCIE0 clk */ +enable_pcie0_clk (); +pcie_init (spear1310_pcie_port_is_host); +#endif +/* Add Platform Devices */ platform_add_devices (plat_devs,ARRAY_SIZE (plat_devs));
arch/arm/mach-spear13xx/spear13xx.c +28 -0
@@ -76,6 +76,34 @@ struct amba_device spear13xx_uart_device = { .irq = {IRQ_UART, NO_IRQ}, }; +#ifdef CONFIG_PCIEPORTBUS +/* PCIE0 clock always needs to be enabled if any of the three PCIE port +* have to be used. So call this function from the board initilization +* file. Ideally , all controller should have been independent from +* others with respect to clock. +*/ +int enable_pcie0_clk (void ) +{ +struct clk *clk; +/*Enable all CLK in CFG registers here only. Idealy only PCIE0 +* should have been enabled. But Controler does not work +* properly if PCIE1 and PCIE2's CFG CLK is enabled in stages. +*/ +writel (PCIE0_CFG_VAL |PCIE1_CFG_VAL |PCIE2_CFG_VAL ,PCIE_CFG ); + clk =clk_get_sys ("pcie0" ,NULL ); +if (IS_ERR (clk)) { +pr_err ("%s:couldn't get clk for pcie0\n" , __func__); +return -ENODEV ; + } +if (clk_enable (clk)) { +pr_err ("%s:couldn't enable clk for pcie0\n" , __func__); +return -ENODEV ; + } + +return 0 ; +} +#endif +/* Do spear13xx familiy common initialization part here */ void __init spear13xx_init (void ) {
arch/arm/plat-spear/Kconfig +2 -0
@@ -12,6 +12,8 @@ config ARCH_SPEAR13XX bool "SPEAr13XX" select ARM_GIC select CPU_V7 + select ARCH_SUPPORTS_MSI + select MIGHT_HAVE_PCI help Supports for ARM's SPEAR13XX family
Signature · 1 line
1.7.2.2
PATCH v6 2/17 ST SPEAr13xx: Added PCIe host controller base driver support.
Quoted 1 line · Viresh Kumar
From: Pratyush Anand <[email protected]>
Hi Viresh and Pratyush,
The code looks really nice, I have just a few comments, mostly about pointer type conversion.
Quoted 2 lines
SPEAr13xx family contains Synopsys designware PCIe version 3.30a. This patch adds support for this PCIe module for spear platform.
If this is a standard PCIe controller, why add it to the platform code instead of a common place like arch/arch/common or arch/arm/kernel ?
arch/arm/mach-spear13xx/include/mach/hardware.h line 29
Quoted 7 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +0
-0@@ -28,4 +28,11 @@/* typesafe io address */ #define __io_address (n) __io(IO_ADDRESS(n))
I could not find the definition for __io() here, but I suspect this is wrong. If __io_address() is what you use for accessing the direct-mapped MMIO registers, it cannot also be what you use to access the PCIe PIO ports, so most likely one of the two is broken. Can you explain?
arch/arm/mach-spear13xx/include/mach/hardware.h line 36
Quoted 6 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +6
-0+#if defined(CONFIG_PCI ) +#define PCIBIOS_MIN_IO 0 +#define PCIBIOS_MIN_MEM 0 +#define pcibios_assign_all_busses () 0 +#endif +
No need for the #ifdef here, if you have no PCI, there won't be a conflict.
Better make PCIBIOS_MIN_IO 0x1000, in order to avoid stepping over ISA port ranges.
arch/arm/mach-spear13xx/include/mach/hardware.h
Quoted 10 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +10
-0+static u32 spr_pcie_base[NUM_PCIE_PORTS ] = { +SPEAR13XX_PCIE0_BASE , +SPEAR13XX_PCIE1_BASE , +SPEAR13XX_PCIE2_BASE , +}; +static u32 spr_pcie_app_base[NUM_PCIE_PORTS ] = { +SPEAR13XX_PCIE0_APP_BASE , +SPEAR13XX_PCIE1_APP_BASE , +SPEAR13XX_PCIE2_APP_BASE , +};
I think these should be __iomem pointers, not u32 tokens, since you are listing virtual addresses. If you unroll the loop in spear13xx_pcie_init() that uses these, you can actually get rid of the two arrays, and simplify the code used there at the same time.
arch/arm/mach-spear13xx/include/mach/hardware.h
Quoted 8 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +8
-0+#ifdef CONFIG_PCI_MSI +static DECLARE_BITMAP(msi_irq_in_use[NUM_PCIE_PORTS], SPEAR_NUM_MSI_IRQS); +static unsigned int spear_msi_data[NUM_PCIE_PORTS ]; + +static void spear13xx_msi_init (struct pcie_port *pp); +#endif + +static void spear_pcie_int_handler (unsigned int irq,struct irq_desc *desc);
It would be nice if you could avoid the forward declarations by reordering the functions if possible.
Quoted 4 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +4
-0+static int __init spear13xx_pcie_setup (int nr,struct pci_sys_data *sys) +{ +struct pcie_port *pp; +u32 val =0 ;
arch/arm/mach-spear13xx/include/mach/hardware.h
Quoted 10 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +10
-0+ +if (nr >=NUM_PCIE_PORTS ) +return 0 ; + +if ((*pcie_port_is_host)(nr) !=1 ) +return 0 ; + + pp = &pcie_port[nr]; +if (!spear13xx_pcie_link_up ((void __iomem *)pp->va_app_base)) +return 0 ;
No need for the cast, va_app_base is already (void __iomem *).
Quoted 9 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +9
-0+static void __init add_pcie_port (int port,u32 base,u32 app_base) +{ +struct pcie_port *pp = &pcie_port[port]; +struct pcie_app_reg *app_reg; + + pp->port = port; + pp->root_bus_nr =-1 ; + pp->base = (void __iomem *)base; + pp->app_base = (void __iomem *)app_base;
arch/arm/mach-spear13xx/include/mach/hardware.h
Quoted 10 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +10
-0+ pp->va_app_base = (void __iomem *)ioremap (app_base,0x200 ); +if (!pp->va_app_base) { +pr_err ("error with ioremap in function %s\n" , __func__); +return ; + } + pp->va_dbi_base = (void __iomem *)ioremap (base,0x2000 ); +if (!pp->va_dbi_base) { +pr_err ("error with ioremap in function %s\n" , __func__); +return ; + }
Please remove all these casts. Some are unneeded, some can go away after the things I mention above.
arch/arm/mach-spear13xx/include/mach/hardware.h
Quoted 10 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +10
-0+spin_lock_init (&pp->conf_lock); +memset (pp->res,0 ,sizeof (pp->res)); +pr_info ("spear13xx PCIe port %d\n" , port); +if (spear13xx_pcie_link_up ((void __iomem *)pp->va_app_base)) { +pr_info ("link up in bios\n" ); + }else { +pr_info ("link down in bios\n" ); +spear13xx_pcie_host_init (pp); +spear13xx_int_init (pp); + app_reg = (struct pcie_app_reg *)pp->va_app_base;
This cast looks invalid, you cast from __iomem to a regular pointer,
arch/arm/mach-spear13xx/include/mach/hardware.h
Quoted 2 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +2
-0+ pp->va_cfg0_base = (void __iomem *) +ioremap (app_reg->in_cfg0_addr_start,IN_CFG0_SIZE );
which breaks here when you pass the value to ioremap without doing a readl.
Quoted 18 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +18
-0+#ifdef CONFIG_PCI_MSI +/* MSI int handler +*/ +static void handle_msi (struct pcie_port *pp) +{ +unsigned long val; +int i, pos; + +for (i =0 ; i <8 ; i++) { +spear_dbi_read_reg (pp,PCIE_MSI_INTR0_STATUS + i *12 ,4 , + (u32 *)&val); +if (val) { + pos =0 ; +while ((pos =find_next_bit (&val,32 , pos)) !=32 ) { +generic_handle_irq (SPEAR_MSI0_INT_BASE + + pp->port *SPEAR_NUM_MSI_IRQS + + (i *32 ) + pos); + pos++;
arch/arm/mach-spear13xx/include/mach/hardware.h
Quoted 10 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +10
-0+ } + } +spear_dbi_write_reg (pp,PCIE_MSI_INTR0_STATUS + i *12 ,4 , val); + } +} +#else +static void handle_msi (struct pcie_port *pp) +{ +} +#endif
The MSI code is not big, but I'd still recommend moving it to a separate file, which gets compiled only when CONFIG_PCI_MSI is set. You can have the #ifdef and inline NOP alternative in a header for this.
Arnd
PATCH v6 2/17 ST SPEAr13xx: Added PCIe host controller base driver support.
Hello Arnd,
Quoted 2 lines · Arnd Bergmann
Quoted 1 line · Viresh Kumar
From: Pratyush Anand <[email protected]>
[...]
Quoted 4 lines
Quoted 4 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +0
-0
Quoted 8 lines
Quoted 3 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +0
-0@@ -28,4 +28,11 @@?/* typesafe io address */
?#define__io_address(n)? ? ? ? ? ? ?__io(IO_ADDRESS(n))I could not find the definition for
__io()here, but I suspect this is wrong. If__io_address()is what you use for accessing the direct-mapped MMIO registers, it cannot also be what you use to access the PCIe PIO ports, so most likely one of the two is broken. Can you explain?
This is not used in PCIe and infact is not part of this PCIe patch. This is used at few places in the architecture code.
Signature · 2 lines
regards Shiraz Hashim
PATCH v6 2/17 ST SPEAr13xx: Added PCIe host controller base driver support.
Quoted 13 lines · shiraz hashim
Quoted 4 lines
Quoted 4 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +0
-0Quoted 8 lines
arch/arm/mach-spear13xx/include/mach/hardware.h line 29
Quoted 3 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +0
-0@@ -28,4 +28,11 @@/* typesafe io address */ #define __io_address (n) __io(IO_ADDRESS(n))I could not find the definition for
__io()here, but I suspect this is wrong. If__io_address()is what you use for accessing the direct-mapped MMIO registers, it cannot also be what you use to access the PCIe PIO ports, so most likely one of the two is broken. Can you explain?
Quoted 2 lines
This is not used in PCIe and infact is not part of this PCIe patch. This is used at few places in the architecture code.
Let me rephrase my point:
The __io() macro is used for accessing PIO registers in PCIe drivers, it needs to be defined to convert I/O port numbers between PCIBIOS_MIN_IO and IO_SPACE_LIMIT to the virtual address that is mapped to the I/O space registers on your PCIe bus.
__io_address() is used in spear13xx to map from physical addresses in the SOC to virtual addresses that are part of the linear mapping set up through iotable_init().
These two are not the same, so I believe that either __io_address() or __io() is broken.
Arnd
PATCH v6 2/17 ST SPEAr13xx: Added PCIe host controller base driver support.
In reply to Arnd BergmannHello Arnd,
Quoted 5 lines · Arnd Bergmann
Quoted 1 line · Viresh Kumar
From: Pratyush Anand <[email protected]>
Hi Viresh and Pratyush,
Quoted 9 lines
The code looks really nice, I have just a few comments, mostly about pointer type conversion.
Quoted 2 lines
SPEAr13xx family contains Synopsys designware PCIe version 3.30a. This patch adds support for this PCIe module for spear platform.
If this is a standard PCIe controller, why add it to the platform code instead of a common place like
arch/arch/commonorarch/arm/kernel?
Yes, It is for Synopsys IP , but there are ST specific changes for accessing HW resources.
Quoted 22 lines
arch/arm/mach-spear13xx/include/mach/hardware.h line 29
Quoted 7 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +0
-0@@ -28,4 +28,11 @@/* typesafe io address */ #define __io_address (n) __io(IO_ADDRESS(n))I could not find the definition for
__io()here, but I suspect this is wrong. If__io_address()is what you use for accessing the direct-mapped MMIO registers, it cannot also be what you use to access the PCIe PIO ports, so most likely one of the two is broken. Can you explain?arch/arm/mach-spear13xx/include/mach/hardware.h line 36
Quoted 6 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +6
-0+#if defined(CONFIG_PCI ) +#define PCIBIOS_MIN_IO 0 +#define PCIBIOS_MIN_MEM 0 +#define pcibios_assign_all_busses () 0 +#endif +No need for the #ifdef here, if you have no PCI, there won't be a conflict.
Quoted 3 lines
Better make
PCIBIOS_MIN_IO0x1000, in order to avoid stepping over ISA port ranges.
In fact , I do not need these defines. I will remove them.
Quoted 8 lines
Quoted 8 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +8
-0+static u32 spr_pcie_base[NUM_PCIE_PORTS ] = { +SPEAR13XX_PCIE0_BASE , +SPEAR13XX_PCIE1_BASE , +SPEAR13XX_PCIE2_BASE , +}; +static u32 spr_pcie_app_base[NUM_PCIE_PORTS ] = { +SPEAR13XX_PCIE0_APP_BASE , +SPEAR13XX_PCIE1_APP_BASE ,
Quoted 9 lines
arch/arm/mach-spear13xx/include/mach/hardware.h
Quoted 2 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +2
-0+ SPEAR13XX_PCIE2_APP_BASE, +};I think these should be
__iomempointers, not u32 tokens, since you are listing virtual addresses. If you unroll the loop inspear13xx_pcie_init()that uses these, you can actually get rid of the two arrays, and simplify the code used there at the same time.
will do it.
Quoted 12 lines
arch/arm/mach-spear13xx/include/mach/hardware.h
Quoted 8 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +8
-0+#ifdef CONFIG_PCI_MSI +static DECLARE_BITMAP(msi_irq_in_use[NUM_PCIE_PORTS], SPEAR_NUM_MSI_IRQS); +static unsigned int spear_msi_data[NUM_PCIE_PORTS ]; + +static void spear13xx_msi_init (struct pcie_port *pp); +#endif + +static void spear_pcie_int_handler (unsigned int irq,struct irq_desc *desc);It would be nice if you could avoid the forward declarations by reordering the functions if possible.
will do it.
Quoted 8 lines
Quoted 8 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +8
-0+static int __init spear13xx_pcie_setup (int nr,struct pci_sys_data *sys) +{ +struct pcie_port *pp; +u32 val =0 ; + +if (nr >=NUM_PCIE_PORTS ) +return 0 ; +
Quoted 9 lines
arch/arm/mach-spear13xx/include/mach/hardware.h
Quoted 6 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +6
-0+if ((*pcie_port_is_host)(nr) !=1 ) +return 0 ; + + pp = &pcie_port[nr]; +if (!spear13xx_pcie_link_up ((void __iomem *)pp->va_app_base)) +return 0 ;No need for the cast,
va_app_baseis already (void__iomem*).
ok.
Quoted 14 lines
Quoted 14 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +14
-0+static void __init add_pcie_port (int port,u32 base,u32 app_base) +{ +struct pcie_port *pp = &pcie_port[port]; +struct pcie_app_reg *app_reg; + + pp->port = port; + pp->root_bus_nr =-1 ; + pp->base = (void __iomem *)base; + pp->app_base = (void __iomem *)app_base; + pp->va_app_base = (void __iomem *)ioremap (app_base,0x200 ); +if (!pp->va_app_base) { +pr_err ("error with ioremap in function %s\n" , __func__); +return ; + }
Quoted 9 lines
arch/arm/mach-spear13xx/include/mach/hardware.h
Quoted 5 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +5
-0+ pp->va_dbi_base = (void __iomem *)ioremap (base,0x2000 ); +if (!pp->va_dbi_base) { +pr_err ("error with ioremap in function %s\n" , __func__); +return ; + }Please remove all these casts. Some are unneeded, some can go away after the things I mention above.
ok.
Quoted 4 lines
Quoted 4 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +4
-0+spin_lock_init (&pp->conf_lock); +memset (pp->res,0 ,sizeof (pp->res)); +pr_info ("spear13xx PCIe port %d\n" , port); +if (spear13xx_pcie_link_up ((void __iomem *)pp->va_app_base)) {
Quoted 9 lines
arch/arm/mach-spear13xx/include/mach/hardware.h
Quoted 6 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +6
-0+pr_info ("link up in bios\n" ); + }else { +pr_info ("link down in bios\n" ); +spear13xx_pcie_host_init (pp); +spear13xx_int_init (pp); + app_reg = (struct pcie_app_reg *)pp->va_app_base;This cast looks invalid, you cast from
__iomemto a regular pointer,
will typecast it with (struct pcie_app_reg __iomem*)
Quoted 5 lines
arch/arm/mach-spear13xx/include/mach/hardware.h
Quoted 2 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +2
-0+ pp->va_cfg0_base = (void __iomem *) +ioremap (app_reg->in_cfg0_addr_start,IN_CFG0_SIZE );which breaks here when you pass the value to ioremap without doing a readl.
will modify.
Quoted 24 lines
Quoted 24 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +24
-0+#ifdef CONFIG_PCI_MSI +/* MSI int handler +*/ +static void handle_msi (struct pcie_port *pp) +{ +unsigned long val; +int i, pos; + +for (i =0 ; i <8 ; i++) { +spear_dbi_read_reg (pp,PCIE_MSI_INTR0_STATUS + i *12 ,4 , + (u32 *)&val); +if (val) { + pos =0 ; +while ((pos =find_next_bit (&val,32 , pos)) !=32 ) { +generic_handle_irq (SPEAR_MSI0_INT_BASE + + pp->port *SPEAR_NUM_MSI_IRQS + + (i *32 ) + pos); + pos++; + } + } +spear_dbi_write_reg (pp,PCIE_MSI_INTR0_STATUS + i *12 ,4 , val); + } +} +#else
Quoted 9 lines
arch/arm/mach-spear13xx/include/mach/hardware.h
Quoted 4 lines
arch/arm/mach-spear13xx/include/mach/hardware.h +4
-0+static void handle_msi (struct pcie_port *pp) +{ +} +#endif The MSI code is not big, but I'd still recommend moving it to a separate file, which gets compiled only when
CONFIG_PCI_MSIis set. You can have the #ifdef and inline NOP alternative in a header for this.
will put it in a separate file.
Regards
Pratyush
Quoted 3 lines
Arnd
.
PATCH v6 3/17 ST SPEAr: Adding PLGPIO driver for spear platform
In reply to Viresh KumarPlgpio pads on few spear machines can be configured as gpios. This patch add support for configuring these PLGPIOs.
--- arch/arm/mach-spear3xx/include/mach/generic.h | 2 + arch/arm/mach-spear3xx/include/mach/gpio.h | 143 ++++++++ arch/arm/mach-spear3xx/spear310.c | 68 ++++ arch/arm/mach-spear3xx/spear310_evb.c | 1 + arch/arm/mach-spear3xx/spear320.c | 28 ++ arch/arm/mach-spear3xx/spear320_evb.c | 1 + arch/arm/mach-spear6xx/include/mach/gpio.h | 27 ++ arch/arm/plat-spear/Makefile | 2 + arch/arm/plat-spear/include/plat/gpio.h | 35 ++ arch/arm/plat-spear/plgpio.c | 473 +++++++++++++++++++++++++ 10 files changed, 780 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-spear/plgpio.c
arch/arm/mach-spear3xx/include/mach/generic.h +2 -0
@@ -145,6 +145,7 @@ void __init spear300_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,/* spear310 declarations */ #ifdef CONFIG_MACH_SPEAR310 /* Add spear310 machine device structure declarations here */ +extern struct platform_device spear310_plgpio_device;/* pad mux devices */ extern struct pmx_dev spear310_pmx_emi_cs_0_1_4_5;
@@ -166,6 +167,7 @@ void __init spear310_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,/* spear320 declarations */ #ifdef CONFIG_MACH_SPEAR320 /* Add spear320 machine device structure declarations here */ +extern struct platform_device spear320_plgpio_device;/* pad mux modes */ extern struct pmx_mode spear320_auto_net_smii_mode;
arch/arm/mach-spear3xx/include/mach/gpio.h +143 -0
147 lines not on this page · raw message
arch/arm/mach-spear3xx/spear310.c +68 -0
80 lines not on this page · raw message
arch/arm/mach-spear3xx/spear310_evb.c +1 -0
@@ -52,6 +52,7 @@ static struct platform_device *plat_devs[] __initdata = {/* spear3xx specific devices */ /* spear310 specific devices */ + &spear310_plgpio_device, };static void __init spear310_evb_init (void )
arch/arm/mach-spear3xx/spear320.c +28 -0
@@ -13,6 +13,7 @@#include <linux/ptrace.h> #include <asm/irq.h> +#include <plat/gpio.h> #include <plat/shirq.h> #include <mach/generic.h> #include <mach/hardware.h>
@@ -711,6 +712,33 @@ static struct spear_shirq shirq_intrcomm_ras = { };/* Add spear320 specific devices here */ +/* plgpio device registeration */ +static struct plgpio_platform_data plgpio_plat_data = { + .gpio_base =8 , + .irq_base =SPEAR3XX_PLGPIO_INT_BASE , + .gpio_count =SPEAR3XX_PLGPIO_COUNT , +}; + +static struct resource plgpio_resources[] = { + { + .start =SPEAR320_SOC_CONFIG_BASE , + .end =SPEAR320_SOC_CONFIG_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, { + .start =SPEAR320_VIRQ_PLGPIO , + .flags =IORESOURCE_IRQ , + }, +}; + +struct platform_device spear320_plgpio_device = { + .name ="plgpio" , + .id =-1 , + .dev = { + .platform_data = &plgpio_plat_data, + }, + .num_resources =ARRAY_SIZE (plgpio_resources), + .resource = plgpio_resources, +};/* spear320 routines */ void __init spear320_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
arch/arm/mach-spear3xx/spear320_evb.c +1 -0
@@ -49,6 +49,7 @@ static struct platform_device *plat_devs[] __initdata = {/* spear3xx specific devices */ /* spear320 specific devices */ + &spear320_plgpio_device, };static void __init spear320_evb_init (void )
arch/arm/mach-spear6xx/include/mach/gpio.h +27 -0
@@ -16,4 +16,31 @@#include <plat/gpio.h> +#define CPU_GPIO_0 0 +#define CPU_GPIO_1 1 +#define CPU_GPIO_2 2 +#define CPU_GPIO_3 3 +#define CPU_GPIO_4 4 +#define CPU_GPIO_5 5 +#define CPU_GPIO_6 6 +#define CPU_GPIO_7 7 + +#define BASIC_GPIO_0 8 +#define BASIC_GPIO_1 9 +#define BASIC_GPIO_2 10 +#define BASIC_GPIO_3 11 +#define BASIC_GPIO_4 12 +#define BASIC_GPIO_5 13 +#define BASIC_GPIO_6 14 +#define BASIC_GPIO_7 15 + +#define APPL_GPIO_0 16 +#define APPL_GPIO_1 17 +#define APPL_GPIO_2 18 +#define APPL_GPIO_3 19 +#define APPL_GPIO_4 20 +#define APPL_GPIO_5 21 +#define APPL_GPIO_6 22 +#define APPL_GPIO_7 23 +#endif /* __MACH_GPIO_H */
arch/arm/plat-spear/Makefile +2 -0
@@ -7,3 +7,5 @@ obj-y := clock.o time.o obj-$(CONFIG_ARCH_SPEAR13XX) += padmux.o obj-$(CONFIG_ARCH_SPEAR3XX) += shirq.o padmux.o +obj-$(CONFIG_MACH_SPEAR310) += plgpio.o +obj-$(CONFIG_MACH_SPEAR320) += plgpio.o
arch/arm/plat-spear/include/plat/gpio.h +35 -0
@@ -21,4 +21,39 @@#define gpio_cansleep __gpio_cansleep#define gpio_to_irq __gpio_to_irq +/* plgpio driver declarations */ +/* +* plgpio pins in all machines are not one to one mapped, bitwise with +* registers bits. These set of macros define register masks for which below +* functions (pin_to_offset and offset_to_pin) are required to be called. +*/ +#define PTO_ENB_REG 0x001 +#define PTO_WDATA_REG 0x002 +#define PTO_DIR_REG 0x004 +#define PTO_IE_REG 0x008 +#define PTO_RDATA_REG 0x010 +#define PTO_MIS_REG 0x020 + +/* functions for converting pin to correct offset in register and vice versa */ +/** +* struct plgpio_platform_data: plgpio driver platform data +* +* gpio_base: gpio start number of plgpios +* irq_base: irq number of plgpio0 +* gpio_count: total count of plgpios +* p2o: function ptr for pin to offset conversion. This is required only for +* machines where mapping b/w pin and offset is not 1-to-1. +* o2p: function ptr for offset to pin conversion. This is required only for +* machines where mapping b/w pin and offset is not 1-to-1. +* p2o_regs: mask of registers for which p2o and o2p are applicable +*/ +struct plgpio_platform_data { +u32 gpio_base; +u32 irq_base; +u32 gpio_count; +int (*p2o)(int pin);/* pin_to_offset */ +int (*o2p)(int offset);/* offset_to_pin */ +u32 p2o_regs; +}; +#endif /* __PLAT_GPIO_H */
arch/arm/plat-spear/plgpio.c new file +473 -0
473 lines not on this page · raw message
Signature · 1 line
1.7.2.2
PATCH v6 4/17 ST SPEAr3xx: Adding support for ST's PWM IP
In reply to Viresh Kumar--- arch/arm/mach-spear3xx/include/mach/generic.h | 1 + arch/arm/mach-spear3xx/spear320.c | 16 + arch/arm/mach-spear3xx/spear320_evb.c | 1 + arch/arm/plat-spear/Kconfig | 7 + arch/arm/plat-spear/Makefile | 2 + arch/arm/plat-spear/pwm.c | 484 +++++++++++++++++++++++++ 6 files changed, 511 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-spear/pwm.c
arch/arm/mach-spear3xx/include/mach/generic.h +1 -0
@@ -168,6 +168,7 @@ void __init spear310_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,#ifdef CONFIG_MACH_SPEAR320 /* Add spear320 machine device structure declarations here */ extern struct platform_device spear320_plgpio_device; +extern struct platform_device spear320_pwm_device;/* pad mux modes */ extern struct pmx_mode spear320_auto_net_smii_mode;
arch/arm/mach-spear3xx/spear320.c +16 -0
@@ -740,6 +740,22 @@ struct platform_device spear320_plgpio_device = { .resource = plgpio_resources, }; +/* pwm device registeration */ +static struct resource pwm_resources[] = { + { + .start =SPEAR320_PWM_BASE , + .end =SPEAR320_PWM_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, +}; + +struct platform_device spear320_pwm_device = { + .name ="pwm" , + .id =-1 , + .num_resources =ARRAY_SIZE (pwm_resources), + .resource = pwm_resources, +}; +/* spear320 routines */ void __init spear320_init (struct pmx_mode *pmx_mode,struct pmx_dev **pmx_devs,u8 pmx_dev_count)
arch/arm/mach-spear3xx/spear320_evb.c +1 -0
@@ -50,6 +50,7 @@ static struct platform_device *plat_devs[] __initdata = {/* spear320 specific devices */ &spear320_plgpio_device, + &spear320_pwm_device, };static void __init spear320_evb_init (void )
arch/arm/plat-spear/Kconfig +7 -0
@@ -38,4 +38,11 @@ source "arch/arm/mach-spear13xx/Kconfig" source "arch/arm/mach-spear3xx/Kconfig" source "arch/arm/mach-spear6xx/Kconfig" +config SPEAR_PWM + tristate "SPEAr Pulse Width Modulator" + depends on MACH_SPEAR320 + default y + help + Support for ST Microelectronics Pulse Width Modulator present on SPEAr Platform. + endif
arch/arm/plat-spear/Makefile +2 -0
@@ -9,3 +9,5 @@ obj-$(CONFIG_ARCH_SPEAR13XX) += padmux.o obj-$(CONFIG_ARCH_SPEAR3XX) += shirq.o padmux.o obj-$(CONFIG_MACH_SPEAR310) += plgpio.o obj-$(CONFIG_MACH_SPEAR320) += plgpio.o + +obj-$(CONFIG_SPEAR_PWM) += pwm.o
arch/arm/plat-spear/pwm.c new file +484 -0
484 lines not on this page · raw message
Signature · 1 line
1.7.2.2
PATCH v6 5/17 ST SPEAr: Adding Watchdog support on spear3xx & spear6xx machines
In reply to Viresh Kumar--- arch/arm/mach-spear3xx/include/mach/generic.h | 1 + arch/arm/mach-spear3xx/spear300_evb.c | 1 + arch/arm/mach-spear3xx/spear310_evb.c | 1 + arch/arm/mach-spear3xx/spear320_evb.c | 1 + arch/arm/mach-spear3xx/spear3xx.c | 12 ++++++++++++ arch/arm/mach-spear6xx/include/mach/generic.h | 1 + arch/arm/mach-spear6xx/spear600_evb.c | 1 + arch/arm/mach-spear6xx/spear6xx.c | 12 ++++++++++++ 8 files changed, 30 insertions(+), 0 deletions(-)
arch/arm/mach-spear3xx/include/mach/generic.h +1 -0
@@ -33,6 +33,7 @@/* Add spear3xx family device structure declarations here */ extern struct amba_device spear3xx_gpio_device;extern struct amba_device spear3xx_uart_device; +extern struct amba_device spear3xx_wdt_device;extern struct sys_timer spear3xx_timer;/* Add spear3xx family function declarations here */
arch/arm/mach-spear3xx/spear300_evb.c +1 -0
@@ -36,6 +36,7 @@ static struct amba_device *amba_devs[] __initdata = {/* spear3xx specific devices */ &spear3xx_gpio_device, &spear3xx_uart_device, + &spear3xx_wdt_device,/* spear300 specific devices */ &spear300_gpio1_device,
arch/arm/mach-spear3xx/spear310_evb.c +1 -0
@@ -44,6 +44,7 @@ static struct amba_device *amba_devs[] __initdata = {/* spear3xx specific devices */ &spear3xx_gpio_device, &spear3xx_uart_device, + &spear3xx_wdt_device, /* spear310 specific devices */ };
arch/arm/mach-spear3xx/spear320_evb.c +1 -0
@@ -41,6 +41,7 @@ static struct amba_device *amba_devs[] __initdata = {/* spear3xx specific devices */ &spear3xx_gpio_device, &spear3xx_uart_device, + &spear3xx_wdt_device, /* spear320 specific devices */ };
arch/arm/mach-spear3xx/spear3xx.c +12 -0
@@ -54,6 +54,18 @@ struct amba_device spear3xx_uart_device = { .irq = {SPEAR3XX_IRQ_UART, NO_IRQ}, }; +/* watchdog device registeration */ +struct amba_device spear3xx_wdt_device = { + .dev = { + .init_name ="wdt" , + }, + .res = { + .start =SPEAR3XX_ICM3_WDT_BASE , + .end =SPEAR3XX_ICM3_WDT_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, +}; +/* Do spear3xx familiy common initialization part here */ void __init spear3xx_init (void ) {
arch/arm/mach-spear6xx/include/mach/generic.h +1 -0
@@ -31,6 +31,7 @@/* Add spear6xx family device structure declarations here */ extern struct amba_device gpio_device[];extern struct amba_device uart_device[]; +extern struct amba_device wdt_device;extern struct sys_timer spear6xx_timer;/* Add spear6xx family function declarations here */
arch/arm/mach-spear6xx/spear600_evb.c +1 -0
@@ -22,6 +22,7 @@ static struct amba_device *amba_devs[] __initdata = { &gpio_device[2 ], &uart_device[0 ], &uart_device[1 ], + &wdt_device, }; static struct platform_device *plat_devs[] __initdata = {
arch/arm/mach-spear6xx/spear6xx.c +12 -0
@@ -99,6 +99,18 @@ struct amba_device gpio_device[] = { } }; +/* watchdog device registeration */ +struct amba_device wdt_device = { + .dev = { + .init_name ="wdt" , + }, + .res = { + .start =SPEAR6XX_ICM3_WDT_BASE , + .end =SPEAR6XX_ICM3_WDT_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, +}; +/* This will add devices, and do machine specific tasks */ void __init spear6xx_init (void ) {
Signature · 1 line
1.7.2.2
PATCH v6 6/17 ST SPEAr3xx: Adding RAS uart devices
In reply to Viresh Kumar--- arch/arm/mach-spear3xx/include/mach/generic.h | 7 +++ arch/arm/mach-spear3xx/spear310.c | 65 +++++++++++++++++++++++++ arch/arm/mach-spear3xx/spear310_evb.c | 5 ++ arch/arm/mach-spear3xx/spear320.c | 26 ++++++++++ arch/arm/mach-spear3xx/spear320_evb.c | 2 + 5 files changed, 105 insertions(+), 0 deletions(-)
arch/arm/mach-spear3xx/include/mach/generic.h +7 -0
@@ -146,6 +146,11 @@ void __init spear300_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,/* spear310 declarations */ #ifdef CONFIG_MACH_SPEAR310 /* Add spear310 machine device structure declarations here */ +extern struct amba_device spear310_uart1_device; +extern struct amba_device spear310_uart2_device; +extern struct amba_device spear310_uart3_device; +extern struct amba_device spear310_uart4_device; +extern struct amba_device spear310_uart5_device;extern struct platform_device spear310_plgpio_device;/* pad mux devices */
@@ -168,6 +173,8 @@ void __init spear310_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,/* spear320 declarations */ #ifdef CONFIG_MACH_SPEAR320 /* Add spear320 machine device structure declarations here */ +extern struct amba_device spear320_uart1_device; +extern struct amba_device spear320_uart2_device;extern struct platform_device spear320_plgpio_device;extern struct platform_device spear320_pwm_device;
arch/arm/mach-spear3xx/spear310.c +65 -0
71 lines not on this page · raw message
arch/arm/mach-spear3xx/spear310_evb.c +5 -0
@@ -47,6 +47,11 @@ static struct amba_device *amba_devs[] __initdata = { &spear3xx_wdt_device,/* spear310 specific devices */ + &spear310_uart1_device, + &spear310_uart2_device, + &spear310_uart3_device, + &spear310_uart4_device, + &spear310_uart5_device, }; static struct platform_device *plat_devs[] __initdata = {
arch/arm/mach-spear3xx/spear320.c +26 -0
@@ -712,6 +712,32 @@ static struct spear_shirq shirq_intrcomm_ras = { };/* Add spear320 specific devices here */ +/* uart1 device registeration */ +struct amba_device spear320_uart1_device = { + .dev = { + .init_name ="uart1" , + }, + .res = { + .start =SPEAR320_UART1_BASE , + .end =SPEAR320_UART1_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, + .irq = {SPEAR320_VIRQ_UART1 ,NO_IRQ }, +}; + +/* uart2 device registeration */ +struct amba_device spear320_uart2_device = { + .dev = { + .init_name ="uart2" , + }, + .res = { + .start =SPEAR320_UART2_BASE , + .end =SPEAR320_UART2_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, + .irq = {SPEAR320_VIRQ_UART2 ,NO_IRQ }, +}; +/* plgpio device registeration */ static struct plgpio_platform_data plgpio_plat_data = { .gpio_base =8 ,
arch/arm/mach-spear3xx/spear320_evb.c +2 -0
@@ -44,6 +44,8 @@ static struct amba_device *amba_devs[] __initdata = { &spear3xx_wdt_device,/* spear320 specific devices */ + &spear320_uart1_device, + &spear320_uart2_device, }; static struct platform_device *plat_devs[] __initdata = {
Signature · 1 line
1.7.2.2
PATCH v6 7/17 ST SPEAr320: Adding support for CAN
In reply to Viresh Kumar--- arch/arm/mach-spear3xx/include/mach/generic.h | 2 + arch/arm/mach-spear3xx/spear320.c | 37 +++++++++++++++++++++++++ arch/arm/mach-spear3xx/spear320_evb.c | 2 + 3 files changed, 41 insertions(+), 0 deletions(-)
arch/arm/mach-spear3xx/include/mach/generic.h +2 -0
@@ -175,6 +175,8 @@ void __init spear310_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,/* Add spear320 machine device structure declarations here */ extern struct amba_device spear320_uart1_device;extern struct amba_device spear320_uart2_device; +extern struct platform_device spear320_can0_device; +extern struct platform_device spear320_can1_device;extern struct platform_device spear320_plgpio_device;extern struct platform_device spear320_pwm_device;
arch/arm/mach-spear3xx/spear320.c +37 -0
@@ -738,6 +738,43 @@ struct amba_device spear320_uart2_device = { .irq = {SPEAR320_VIRQ_UART2, NO_IRQ}, }; +/* CAN device registeration */ +static struct resource can0_resources[] = { + { + .start =SPEAR320_CAN0_BASE , + .end =SPEAR320_CAN0_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM |IORESOURCE_MEM_32BIT , + }, { + .start =SPEAR320_VIRQ_CANU , + .flags =IORESOURCE_IRQ , + }, +}; + +struct platform_device spear320_can0_device = { + .name ="c_can_platform" , + .id =0 , + .num_resources =ARRAY_SIZE (can0_resources), + .resource = can0_resources, +}; + +static struct resource can1_resources[] = { + { + .start =SPEAR320_CAN1_BASE , + .end =SPEAR320_CAN1_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM |IORESOURCE_MEM_32BIT , + }, { + .start =SPEAR320_VIRQ_CANL , + .flags =IORESOURCE_IRQ , + }, +}; + +struct platform_device spear320_can1_device = { + .name ="c_can_platform" , + .id =1 , + .num_resources =ARRAY_SIZE (can1_resources), + .resource = can1_resources, +}; +/* plgpio device registeration */ static struct plgpio_platform_data plgpio_plat_data = { .gpio_base = 8,
arch/arm/mach-spear3xx/spear320_evb.c +2 -0
@@ -52,6 +52,8 @@ static struct platform_device *plat_devs[] __initdata = {/* spear3xx specific devices */ /* spear320 specific devices */ + &spear320_can0_device, + &spear320_can1_device, &spear320_plgpio_device, &spear320_pwm_device, };
Signature · 1 line
1.7.2.2
PATCH v6 8/17 ST SPEAr3xx: EMI (External Memory Interface) controller driver
In reply to Viresh KumarFrom: Vipin Kumar <[email protected]>
Two SPEAr platform SoCs(spear310 and spear320) support an External Memory Interface controller. This controller is used to interface with Parallel NOR Flash devices.
This patch adds just the platform code needed for EMI (mainly EMI initialization). The driver being used is driver/mtd/maps/physmap.c
--- arch/arm/mach-spear3xx/Makefile | 4 + arch/arm/mach-spear3xx/emi.c | 98 ++++++++++++++++++++++++ arch/arm/mach-spear3xx/include/mach/emi.h | 61 +++++++++++++++ arch/arm/mach-spear3xx/include/mach/spear310.h | 9 ++ arch/arm/mach-spear3xx/include/mach/spear320.h | 6 ++ arch/arm/mach-spear3xx/spear310_evb.c | 35 +++++++++ arch/arm/mach-spear3xx/spear320_evb.c | 35 +++++++++ 7 files changed, 248 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-spear3xx/emi.c create mode 100644 arch/arm/mach-spear3xx/include/mach/emi.h
arch/arm/mach-spear3xx/Makefile +4 -0
@@ -24,3 +24,7 @@ obj-$(CONFIG_MACH_SPEAR320) += spear320.o # spear320 boards files obj-$(CONFIG_BOARD_SPEAR320_EVB) += spear320_evb.o + +# specific files +obj-$(CONFIG_MACH_SPEAR310) += emi.o +obj-$(CONFIG_MACH_SPEAR320) += emi.o
arch/arm/mach-spear3xx/emi.c new file +98 -0
98 lines not on this page · raw message
arch/arm/mach-spear3xx/include/mach/emi.h new file +61 -0
61 lines not on this page · raw message
arch/arm/mach-spear3xx/include/mach/spear310.h +9 -0
@@ -18,6 +18,15 @@#define SPEAR310_NAND_BASE UL(0x40000000)#define SPEAR310_FSMC_BASE UL(0x44000000) +#define SPEAR310_EMI_REG_BASE UL(0x4F000000) +#define SPEAR310_EMI_MEM_0_BASE UL(0x50000000) +#define SPEAR310_EMI_MEM_1_BASE UL(0x60000000) +#define SPEAR310_EMI_MEM_2_BASE UL(0x70000000) +#define SPEAR310_EMI_MEM_3_BASE UL(0x80000000) +#define SPEAR310_EMI_MEM_4_BASE UL(0x90000000) +#define SPEAR310_EMI_MEM_5_BASE UL(0xA0000000) +#define SPEAR310_EMI_MEM_SIZE UL(0x10000000) +#define SPEAR310_UART1_BASE UL(0xB2000000)#define SPEAR310_UART2_BASE UL(0xB2080000)#define SPEAR310_UART3_BASE UL(0xB2100000)
arch/arm/mach-spear3xx/include/mach/spear320.h +6 -0
@@ -17,6 +17,12 @@#define __MACH_SPEAR320_H#define SPEAR320_EMI_CTRL_BASE UL(0x40000000) +#define SPEAR320_EMI_MEM_0_BASE UL(0x44000000) +#define SPEAR320_EMI_MEM_1_BASE UL(0x45000000) +#define SPEAR320_EMI_MEM_2_BASE UL(0x46000000) +#define SPEAR320_EMI_MEM_3_BASE UL(0x47000000) +#define SPEAR320_EMI_MEM_SIZE UL(0x01000000) +#define SPEAR320_FSMC_BASE UL(0x4C000000)#define SPEAR320_NAND_BASE UL(0x50000000)#define SPEAR320_I2S_BASE UL(0x60000000)
arch/arm/mach-spear3xx/spear310_evb.c +35 -0
@@ -13,9 +13,40 @@#include <asm/mach/arch.h> #include <asm/mach-types.h> +#include <mach/emi.h> #include <mach/generic.h> #include <mach/hardware.h> +#define PARTITION (n, off, sz) {.name = n, .offset = off, .size = sz} +static struct mtd_partition partition_info[] = { +PARTITION ("X-loader" ,0 ,1 *0x20000 ), +PARTITION ("U-Boot" ,0x20000 ,3 *0x20000 ), +PARTITION ("Kernel" ,0x80000 ,24 *0x20000 ), +PARTITION ("Root File System" ,0x380000 ,84 *0x20000 ), +}; + +/* emi nor flash resources registeration */ +static struct resource emi_nor_resources[] = { + { + .start =SPEAR310_EMI_MEM_0_BASE , + .end =SPEAR310_EMI_MEM_0_BASE +SPEAR310_EMI_MEM_SIZE -1 , + .flags =IORESOURCE_MEM , + }, +}; + +static struct physmap_flash_data emi_norflash_data = { + .parts = partition_info, + .nr_parts =ARRAY_SIZE (partition_info), + .width =4 , +}; +static struct platform_device spear310_emi_nor_device = { + .name ="physmap-flash" , + .id =-1 , + .dev.platform_data = &emi_norflash_data, + .resource = emi_nor_resources, + .num_resources =ARRAY_SIZE (emi_nor_resources), +}; +/* padmux devices to enable */ static struct pmx_dev *pmx_devs[] = {/* spear3xx specific devices */
@@ -58,6 +89,7 @@ static struct platform_device *plat_devs[] __initdata = {/* spear3xx specific devices */ /* spear310 specific devices */ + &spear310_emi_nor_device, &spear310_plgpio_device, };
@@ -68,6 +100,9 @@ static void __init spear310_evb_init(void)/* call spear310 machine init function */ spear310_init (NULL , pmx_devs,ARRAY_SIZE (pmx_devs)); +/* Initialize emi regiters */ +emi_init (SPEAR310_EMI_REG_BASE ,0 ,EMI_FLASH_WIDTH32 ); +/* Add Platform Devices */ platform_add_devices (plat_devs,ARRAY_SIZE (plat_devs));
arch/arm/mach-spear3xx/spear320_evb.c +35 -0
@@ -13,9 +13,40 @@#include <asm/mach/arch.h> #include <asm/mach-types.h> +#include <mach/emi.h> #include <mach/generic.h> #include <mach/hardware.h> +#define PARTITION (n, off, sz) {.name = n, .offset = off, .size = sz} +static struct mtd_partition partition_info[] = { +PARTITION ("X-loader" ,0 ,1 *0x20000 ), +PARTITION ("U-Boot" ,0x20000 ,3 *0x20000 ), +PARTITION ("Kernel" ,0x80000 ,24 *0x20000 ), +PARTITION ("Root File System" ,0x380000 ,84 *0x20000 ), +}; + +/* emi nor flash resources registeration */ +static struct resource emi_nor_resources[] = { + { + .start =SPEAR320_EMI_MEM_0_BASE , + .end =SPEAR320_EMI_MEM_0_BASE +SPEAR320_EMI_MEM_SIZE -1 , + .flags =IORESOURCE_MEM , + }, +}; + +static struct physmap_flash_data emi_norflash_data = { + .parts = partition_info, + .nr_parts =ARRAY_SIZE (partition_info), + .width =2 , +}; +static struct platform_device spear320_emi_nor_device = { + .name ="physmap-flash" , + .id =-1 , + .dev.platform_data = &emi_norflash_data, + .resource = emi_nor_resources, + .num_resources =ARRAY_SIZE (emi_nor_resources), +}; +/* padmux devices to enable */ static struct pmx_dev *pmx_devs[] = {/* spear3xx specific devices */
@@ -54,6 +85,7 @@ static struct platform_device *plat_devs[] __initdata = {/* spear320 specific devices */ &spear320_can0_device, &spear320_can1_device, + &spear320_emi_nor_device, &spear320_plgpio_device, &spear320_pwm_device, };
@@ -66,6 +98,9 @@ static void __init spear320_evb_init(void)spear320_init (&spear320_auto_net_mii_mode, pmx_devs,ARRAY_SIZE (pmx_devs)); +/* Initialize emi regiters */ +emi_init (SPEAR320_EMI_CTRL_BASE ,0 ,EMI_FLASH_WIDTH16 ); +/* Add Platform Devices */ platform_add_devices (plat_devs,ARRAY_SIZE (plat_devs));
Signature · 1 line
1.7.2.2
PATCH v6 9/17 ST SPEAr: Adding machine support for rtc-spear
In reply to Viresh KumarFrom: Rajeev Kumar <[email protected]>
--- arch/arm/mach-spear13xx/include/mach/generic.h | 1 + arch/arm/mach-spear13xx/spear1300_evb.c | 1 + arch/arm/mach-spear13xx/spear1310_evb.c | 1 + arch/arm/mach-spear13xx/spear13xx.c | 19 +++++++++++++++++++ arch/arm/mach-spear3xx/include/mach/generic.h | 1 + arch/arm/mach-spear3xx/spear300_evb.c | 1 + arch/arm/mach-spear3xx/spear310_evb.c | 1 + arch/arm/mach-spear3xx/spear320_evb.c | 1 + arch/arm/mach-spear3xx/spear3xx.c | 19 +++++++++++++++++++ arch/arm/mach-spear6xx/include/mach/generic.h | 1 + arch/arm/mach-spear6xx/spear600_evb.c | 1 + arch/arm/mach-spear6xx/spear6xx.c | 19 +++++++++++++++++++ 12 files changed, 66 insertions(+), 0 deletions(-)
arch/arm/mach-spear13xx/include/mach/generic.h +1 -0
@@ -223,6 +223,7 @@ extern struct pmx_dev pmx_uart1_modem;/* Add spear13xx family device structure declarations here */ extern struct amba_device spear13xx_gpio_device[];extern struct amba_device spear13xx_uart_device; +extern struct platform_device spear13xx_rtc_device;extern struct sys_timer spear13xx_timer;/* Add spear13xx family function declarations here */
arch/arm/mach-spear13xx/spear1300_evb.c +1 -0
@@ -44,6 +44,7 @@ static struct amba_device *amba_devs[] __initdata = { };static struct platform_device *plat_devs[]__initdata = { + &spear13xx_rtc_device, };#ifdef CONFIG_PCIEPORTBUS
arch/arm/mach-spear13xx/spear1310_evb.c +1 -0
@@ -59,6 +59,7 @@ static struct amba_device *amba_devs[] __initdata = {static struct platform_device *plat_devs[]__initdata = {/* spear13xx specific devices */ + &spear13xx_rtc_device,/* spear1310 specific devices */ &spear1310_can0_device,
arch/arm/mach-spear13xx/spear13xx.c +19 -0
@@ -76,6 +76,25 @@ struct amba_device spear13xx_uart_device = { .irq = {IRQ_UART, NO_IRQ}, }; +/* rtc device registration */ +static struct resource rtc_resources[] = { + { + .start =SPEAR13XX_RTC_BASE , + .end =SPEAR13XX_RTC_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, { + .start =IRQ_RTC , + .flags =IORESOURCE_IRQ , + }, +}; + +struct platform_device spear13xx_rtc_device = { + .name ="rtc-spear" , + .id =-1 , + .num_resources =ARRAY_SIZE (rtc_resources), + .resource = rtc_resources, +}; +#ifdef CONFIG_PCIEPORTBUS /* PCIE0 clock always needs to be enabled if any of the three PCIE port * have to be used. So call this function from the board initilization
arch/arm/mach-spear3xx/include/mach/generic.h +1 -0
@@ -34,6 +34,7 @@extern struct amba_device spear3xx_gpio_device;extern struct amba_device spear3xx_uart_device;extern struct amba_device spear3xx_wdt_device; +extern struct platform_device spear3xx_rtc_device;extern struct sys_timer spear3xx_timer;/* Add spear3xx family function declarations here */
arch/arm/mach-spear3xx/spear300_evb.c +1 -0
@@ -44,6 +44,7 @@ static struct amba_device *amba_devs[] __initdata = {static struct platform_device *plat_devs[]__initdata = {/* spear3xx specific devices */ + &spear3xx_rtc_device,/* spear300 specific devices */ };
arch/arm/mach-spear3xx/spear310_evb.c +1 -0
@@ -87,6 +87,7 @@ static struct amba_device *amba_devs[] __initdata = {static struct platform_device *plat_devs[]__initdata = {/* spear3xx specific devices */ + &spear3xx_rtc_device,/* spear310 specific devices */ &spear310_emi_nor_device,
arch/arm/mach-spear3xx/spear320_evb.c +1 -0
@@ -81,6 +81,7 @@ static struct amba_device *amba_devs[] __initdata = {static struct platform_device *plat_devs[]__initdata = {/* spear3xx specific devices */ + &spear3xx_rtc_device,/* spear320 specific devices */ &spear320_can0_device,
arch/arm/mach-spear3xx/spear3xx.c +19 -0
@@ -66,6 +66,25 @@ struct amba_device spear3xx_wdt_device = { }, }; +/* rtc device registration */ +static struct resource rtc_resources[] = { + { + .start =SPEAR3XX_ICM3_RTC_BASE , + .end =SPEAR3XX_ICM3_RTC_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, { + .start =SPEAR3XX_IRQ_BASIC_RTC , + .flags =IORESOURCE_IRQ , + }, +}; + +struct platform_device spear3xx_rtc_device = { + .name ="rtc-spear" , + .id =-1 , + .num_resources =ARRAY_SIZE (rtc_resources), + .resource = rtc_resources, +}; +/* Do spear3xx familiy common initialization part here */ void __init spear3xx_init (void ) {
arch/arm/mach-spear6xx/include/mach/generic.h +1 -0
@@ -32,6 +32,7 @@extern struct amba_device gpio_device[];extern struct amba_device uart_device[];extern struct amba_device wdt_device; +extern struct platform_device rtc_device;extern struct sys_timer spear6xx_timer;/* Add spear6xx family function declarations here */
arch/arm/mach-spear6xx/spear600_evb.c +1 -0
@@ -26,6 +26,7 @@ static struct amba_device *amba_devs[] __initdata = { };static struct platform_device *plat_devs[]__initdata = { + &rtc_device, };static void __init spear600_evb_init (void )
arch/arm/mach-spear6xx/spear6xx.c +19 -0
@@ -111,6 +111,25 @@ struct amba_device wdt_device = { }, }; +/* rtc device registration */ +static struct resource rtc_resources[] = { + { + .start =SPEAR6XX_ICM3_RTC_BASE , + .end =SPEAR6XX_ICM3_RTC_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, { + .start =IRQ_BASIC_RTC , + .flags =IORESOURCE_IRQ , + }, +}; + +struct platform_device rtc_device = { + .name ="rtc-spear" , + .id =-1 , + .num_resources =ARRAY_SIZE (rtc_resources), + .resource = rtc_resources, +}; +/* This will add devices, and do machine specific tasks */ void __init spear6xx_init (void ) {
Signature · 1 line
1.7.2.2
PATCH v6 10/17 ST SPEAr: adding support for synopsis i2c designware
In reply to Viresh KumarFrom: Rajeev Kumar <[email protected]>
--- arch/arm/mach-spear13xx/include/mach/generic.h | 3 ++ arch/arm/mach-spear13xx/spear1300_evb.c | 4 +++ arch/arm/mach-spear13xx/spear1310.c | 22 ++++++++++++++++++ arch/arm/mach-spear13xx/spear1310_evb.c | 5 ++++ arch/arm/mach-spear13xx/spear13xx.c | 22 ++++++++++++++++++ arch/arm/mach-spear3xx/include/mach/generic.h | 3 ++ arch/arm/mach-spear3xx/spear300_evb.c | 4 +++ arch/arm/mach-spear3xx/spear310_evb.c | 4 +++ arch/arm/mach-spear3xx/spear320.c | 22 ++++++++++++++++++ arch/arm/mach-spear3xx/spear320_evb.c | 5 ++++ arch/arm/mach-spear3xx/spear3xx.c | 22 ++++++++++++++++++ arch/arm/mach-spear6xx/include/mach/generic.h | 2 + arch/arm/mach-spear6xx/spear600_evb.c | 4 +++ arch/arm/mach-spear6xx/spear6xx.c | 22 ++++++++++++++++++ arch/arm/plat-spear/Makefile | 7 +++++ arch/arm/plat-spear/i2c_eval_board.c | 29 ++++++++++++++++++++++++ 16 files changed, 180 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-spear/i2c_eval_board.c
arch/arm/mach-spear13xx/include/mach/generic.h +3 -0
@@ -223,10 +223,12 @@ extern struct pmx_dev pmx_uart1_modem;/* Add spear13xx family device structure declarations here */ extern struct amba_device spear13xx_gpio_device[];extern struct amba_device spear13xx_uart_device; +extern struct platform_device spear13xx_i2c_device;extern struct platform_device spear13xx_rtc_device;extern struct sys_timer spear13xx_timer;/* Add spear13xx family function declarations here */ +void __init i2c_register_default_devices (void );void __init spear13xx_clk_init (void );void __init spear_setup_timer (void );void __init spear13xx_map_io (void );
@@ -252,6 +254,7 @@ extern struct amba_device spear1310_uart4_device;extern struct amba_device spear1310_uart5_device;extern struct platform_device spear1310_can0_device;extern struct platform_device spear1310_can1_device; +extern struct platform_device spear1310_i2c1_device;/* Add spear1310 machine function declarations here */ void __init spear1310_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
arch/arm/mach-spear13xx/spear1300_evb.c +4 -0
@@ -44,6 +44,7 @@ static struct amba_device *amba_devs[] __initdata = { };static struct platform_device *plat_devs[]__initdata = { + &spear13xx_i2c_device, &spear13xx_rtc_device, };
@@ -84,6 +85,9 @@ static void __init spear1300_evb_init(void)pcie_init (spear1300_pcie_port_is_host);#endif +/* Register slave devices on the I2C buses */ +i2c_register_default_devices (); +/* Add Platform Devices */ platform_add_devices (plat_devs,ARRAY_SIZE (plat_devs));
arch/arm/mach-spear13xx/spear1310.c +22 -0
@@ -458,6 +458,28 @@ struct platform_device spear1310_can1_device = { .resource = can1_resources, }; +/* i2c1 device registeration */ +static struct resource i2c1_resources[] = { + { + .start =SPEAR1310_I2C1_BASE , + .end =SPEAR1310_I2C1_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, { + .start =IRQ_I2C_CNTR , + .flags =IORESOURCE_IRQ , + }, +}; + +struct platform_device spear1310_i2c1_device = { + .name ="i2c_designware" , + .id =1 , + .dev = { + .coherent_dma_mask = ~0 , + }, + .num_resources =ARRAY_SIZE (i2c1_resources), + .resource = i2c1_resources, +}; +/* Following will create 1310 specific static virtual/physical mappings */ struct map_desc spear1310_io_desc[]__initdata = { {
arch/arm/mach-spear13xx/spear1310_evb.c +5 -0
@@ -59,11 +59,13 @@ static struct amba_device *amba_devs[] __initdata = {static struct platform_device *plat_devs[]__initdata = {/* spear13xx specific devices */ + &spear13xx_i2c_device, &spear13xx_rtc_device,/* spear1310 specific devices */ &spear1310_can0_device, &spear1310_can1_device, + &spear1310_i2c1_device, };#ifdef CONFIG_PCIEPORTBUS
@@ -103,6 +105,9 @@ static void __init spear1310_evb_init(void)pcie_init (spear1310_pcie_port_is_host);#endif +/* Register slave devices on the I2C buses */ +i2c_register_default_devices (); +/* Add Platform Devices */ platform_add_devices (plat_devs,ARRAY_SIZE (plat_devs));
arch/arm/mach-spear13xx/spear13xx.c +22 -0
@@ -76,6 +76,28 @@ struct amba_device spear13xx_uart_device = { .irq = {IRQ_UART, NO_IRQ}, }; +/* i2c device registeration */ +static struct resource i2c_resources[] = { + { + .start = SPEAR13XX_I2C_BASE, + .end = SPEAR13XX_I2C_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, { + .start = IRQ_I2C, + .flags = IORESOURCE_IRQ, + }, +}; + +struct platform_device spear13xx_i2c_device = { + .name = "i2c_designware", + .id = 0, + .dev = { + .coherent_dma_mask = ~0, + }, + .num_resources = ARRAY_SIZE(i2c_resources), + .resource = i2c_resources, +}; + /* rtc device registration */ static struct resource rtc_resources[] = { {
arch/arm/mach-spear3xx/include/mach/generic.h +3 -0
@@ -34,10 +34,12 @@extern struct amba_device spear3xx_gpio_device;extern struct amba_device spear3xx_uart_device;extern struct amba_device spear3xx_wdt_device; +extern struct platform_device spear3xx_i2c_device;extern struct platform_device spear3xx_rtc_device;extern struct sys_timer spear3xx_timer;/* Add spear3xx family function declarations here */ +void __init i2c_register_default_devices (void );void __init spear3xx_clk_init (void );void __init spear_setup_timer (void );void __init spear3xx_map_io (void );
@@ -178,6 +180,7 @@ extern struct amba_device spear320_uart1_device;extern struct amba_device spear320_uart2_device;extern struct platform_device spear320_can0_device;extern struct platform_device spear320_can1_device; +extern struct platform_device spear320_i2c1_device;extern struct platform_device spear320_plgpio_device;extern struct platform_device spear320_pwm_device;
arch/arm/mach-spear3xx/spear300_evb.c +4 -0
@@ -44,6 +44,7 @@ static struct amba_device *amba_devs[] __initdata = {static struct platform_device *plat_devs[]__initdata = {/* spear3xx specific devices */ + &spear3xx_i2c_device, &spear3xx_rtc_device,/* spear300 specific devices */
@@ -57,6 +58,9 @@ static void __init spear300_evb_init(void)spear300_init (&spear300_photo_frame_mode, pmx_devs,ARRAY_SIZE (pmx_devs)); +/* Register slave devices on the I2C buses */ +i2c_register_default_devices (); +/* Add Platform Devices */ platform_add_devices (plat_devs,ARRAY_SIZE (plat_devs));
arch/arm/mach-spear3xx/spear310_evb.c +4 -0
@@ -87,6 +87,7 @@ static struct amba_device *amba_devs[] __initdata = {static struct platform_device *plat_devs[]__initdata = {/* spear3xx specific devices */ + &spear3xx_i2c_device, &spear3xx_rtc_device,/* spear310 specific devices */
@@ -104,6 +105,9 @@ static void __init spear310_evb_init(void)/* Initialize emi regiters */ emi_init (SPEAR310_EMI_REG_BASE ,0 ,EMI_FLASH_WIDTH32 ); +/* Register slave devices on the I2C buses */ +i2c_register_default_devices (); +/* Add Platform Devices */ platform_add_devices (plat_devs,ARRAY_SIZE (plat_devs));
arch/arm/mach-spear3xx/spear320.c +22 -0
@@ -775,6 +775,28 @@ struct platform_device spear320_can1_device = { .resource = can1_resources, }; +/* i2c1 device registeration */ +static struct resource i2c1_resources[] = { + { + .start =SPEAR320_I2C_BASE , + .end =SPEAR320_I2C_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, { + .start =SPEAR320_VIRQ_I2C1 , + .flags =IORESOURCE_IRQ , + }, +}; + +struct platform_device spear320_i2c1_device = { + .name ="i2c_designware" , + .id =1 , + .dev = { + .coherent_dma_mask = ~0 , + }, + .num_resources =ARRAY_SIZE (i2c1_resources), + .resource = i2c1_resources, +}; +/* plgpio device registeration */ static struct plgpio_platform_data plgpio_plat_data = { .gpio_base =8 ,
arch/arm/mach-spear3xx/spear320_evb.c +5 -0
@@ -81,11 +81,13 @@ static struct amba_device *amba_devs[] __initdata = {static struct platform_device *plat_devs[]__initdata = {/* spear3xx specific devices */ + &spear3xx_i2c_device, &spear3xx_rtc_device,/* spear320 specific devices */ &spear320_can0_device, &spear320_can1_device, + &spear320_i2c1_device, &spear320_emi_nor_device, &spear320_plgpio_device, &spear320_pwm_device,
@@ -102,6 +104,9 @@ static void __init spear320_evb_init(void)/* Initialize emi regiters */ emi_init (SPEAR320_EMI_CTRL_BASE ,0 ,EMI_FLASH_WIDTH16 ); +/* Register slave devices on the I2C buses */ +i2c_register_default_devices (); +/* Add Platform Devices */ platform_add_devices (plat_devs,ARRAY_SIZE (plat_devs));
arch/arm/mach-spear3xx/spear3xx.c +22 -0
@@ -66,6 +66,28 @@ struct amba_device spear3xx_wdt_device = { }, }; +/* i2c device registeration */ +static struct resource i2c_resources[] = { + { + .start =SPEAR3XX_ICM1_I2C_BASE , + .end =SPEAR3XX_ICM1_I2C_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, { + .start =SPEAR3XX_IRQ_I2C , + .flags =IORESOURCE_IRQ , + }, +}; + +struct platform_device spear3xx_i2c_device = { + .name ="i2c_designware" , + .id =0 , + .dev = { + .coherent_dma_mask = ~0 , + }, + .num_resources =ARRAY_SIZE (i2c_resources), + .resource = i2c_resources, +}; +/* rtc device registration */ static struct resource rtc_resources[] = { {
arch/arm/mach-spear6xx/include/mach/generic.h +2 -0
@@ -32,10 +32,12 @@extern struct amba_device gpio_device[];extern struct amba_device uart_device[];extern struct amba_device wdt_device; +extern struct platform_device i2c_device;extern struct platform_device rtc_device;extern struct sys_timer spear6xx_timer;/* Add spear6xx family function declarations here */ +void __init i2c_register_default_devices (void );void __init spear_setup_timer (void );void __init spear6xx_map_io (void );void __init spear6xx_init_irq (void );
arch/arm/mach-spear6xx/spear600_evb.c +4 -0
@@ -26,6 +26,7 @@ static struct amba_device *amba_devs[] __initdata = { };static struct platform_device *plat_devs[]__initdata = { + &i2c_device, &rtc_device, };
@@ -36,6 +37,9 @@ static void __init spear600_evb_init(void)/* call spear600 machine init function */ spear600_init (); +/* Register slave devices on the I2C buses */ +i2c_register_default_devices (); +/* Add Platform Devices */ platform_add_devices (plat_devs,ARRAY_SIZE (plat_devs));
arch/arm/mach-spear6xx/spear6xx.c +22 -0
@@ -111,6 +111,28 @@ struct amba_device wdt_device = { }, }; +/* i2c device registeration */ +static struct resource i2c_resources[] = { + { + .start =SPEAR6XX_ICM1_I2C_BASE , + .end =SPEAR6XX_ICM1_I2C_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, { + .start =IRQ_I2C , + .flags =IORESOURCE_IRQ , + }, +}; + +struct platform_device i2c_device = { + .name ="i2c_designware" , + .id =0 , + .dev = { + .coherent_dma_mask = ~0 , + }, + .num_resources =ARRAY_SIZE (i2c_resources), + .resource = i2c_resources, +}; +/* rtc device registration */ static struct resource rtc_resources[] = { {
arch/arm/plat-spear/Makefile +7 -0
@@ -11,3 +11,10 @@ obj-$(CONFIG_MACH_SPEAR310) += plgpio.o obj-$(CONFIG_MACH_SPEAR320) += plgpio.o obj-$(CONFIG_SPEAR_PWM) += pwm.o + +obj-$(CONFIG_BOARD_SPEAR1300_EVB) += i2c_eval_board.o +obj-$(CONFIG_BOARD_SPEAR1310_EVB) += i2c_eval_board.o +obj-$(CONFIG_BOARD_SPEAR300_EVB) += i2c_eval_board.o +obj-$(CONFIG_BOARD_SPEAR310_EVB) += i2c_eval_board.o +obj-$(CONFIG_BOARD_SPEAR320_EVB) += i2c_eval_board.o +obj-$(CONFIG_BOARD_SPEAR600_EVB) += i2c_eval_board.o
arch/arm/plat-spear/i2c_eval_board.c new file +29 -0
@@ -0,0 +1,29 @@ +/* +* arch/arm/plat-spear/i2c_eval_board.c +* +* Copyright (C) 2010 ST Microelectronics +* Rajeev Kumar<[email protected]> +* +* This file is licensed under the terms of the GNU General Public +* License version 2. This program is licensed "as is" without any +* warranty of any kind, whether express or implied. +*/ + +#include <linux/i2c.h> +#include <linux/kernel.h> + +static struct i2c_board_info __initdata i2c_board_info[] = { + { + .type ="eeprom" , + .addr =0x50 , + }, { + .type ="eeprom" , + .addr =0x51 , + }, +}; + +void __init i2c_register_default_devices (void ) +{ +i2c_register_board_info (0 , i2c_board_info, +ARRAY_SIZE (i2c_board_info)); +}
Signature · 1 line
1.7.2.2
PATCH v6 11/17 ST SPEAr: Adding machine support for USB host
In reply to Viresh KumarFrom: Deepak Sikri <[email protected]>
--- arch/arm/mach-spear13xx/include/mach/generic.h | 4 + arch/arm/mach-spear13xx/spear1300_evb.c | 4 + arch/arm/mach-spear13xx/spear1310_evb.c | 4 + arch/arm/mach-spear13xx/spear13xx.c | 106 +++++++++++++++++++++++ arch/arm/mach-spear3xx/include/mach/generic.h | 3 + arch/arm/mach-spear3xx/spear300_evb.c | 3 + arch/arm/mach-spear3xx/spear310_evb.c | 3 + arch/arm/mach-spear3xx/spear320_evb.c | 3 + arch/arm/mach-spear3xx/spear3xx.c | 77 +++++++++++++++++ arch/arm/mach-spear6xx/include/mach/generic.h | 4 + arch/arm/mach-spear6xx/spear600_evb.c | 4 + arch/arm/mach-spear6xx/spear6xx.c | 108 ++++++++++++++++++++++++ 12 files changed, 323 insertions(+), 0 deletions(-)
arch/arm/mach-spear13xx/include/mach/generic.h +4 -0
@@ -223,7 +223,11 @@ extern struct pmx_dev pmx_uart1_modem;/* Add spear13xx family device structure declarations here */ extern struct amba_device spear13xx_gpio_device[];extern struct amba_device spear13xx_uart_device; +extern struct platform_device spear13xx_ehci0_device; +extern struct platform_device spear13xx_ehci1_device;extern struct platform_device spear13xx_i2c_device; +extern struct platform_device spear13xx_ohci0_device; +extern struct platform_device spear13xx_ohci1_device;extern struct platform_device spear13xx_rtc_device;extern struct sys_timer spear13xx_timer;
arch/arm/mach-spear13xx/spear1300_evb.c +4 -0
@@ -44,7 +44,11 @@ static struct amba_device *amba_devs[] __initdata = { };static struct platform_device *plat_devs[]__initdata = { + &spear13xx_ehci0_device, + &spear13xx_ehci1_device, &spear13xx_i2c_device, + &spear13xx_ohci0_device, + &spear13xx_ohci1_device, &spear13xx_rtc_device, };
arch/arm/mach-spear13xx/spear1310_evb.c +4 -0
@@ -59,7 +59,11 @@ static struct amba_device *amba_devs[] __initdata = {static struct platform_device *plat_devs[]__initdata = {/* spear13xx specific devices */ + &spear13xx_ehci0_device, + &spear13xx_ehci1_device, &spear13xx_i2c_device, + &spear13xx_ohci0_device, + &spear13xx_ohci1_device, &spear13xx_rtc_device,/* spear1310 specific devices */
arch/arm/mach-spear13xx/spear13xx.c +106 -0
112 lines not on this page · raw message
arch/arm/mach-spear3xx/include/mach/generic.h +3 -0
@@ -34,7 +34,10 @@extern struct amba_device spear3xx_gpio_device;extern struct amba_device spear3xx_uart_device;extern struct amba_device spear3xx_wdt_device; +extern struct platform_device spear3xx_ehci_device;extern struct platform_device spear3xx_i2c_device; +extern struct platform_device spear3xx_ohci0_device; +extern struct platform_device spear3xx_ohci1_device;extern struct platform_device spear3xx_rtc_device;extern struct sys_timer spear3xx_timer;
arch/arm/mach-spear3xx/spear300_evb.c +3 -0
@@ -44,7 +44,10 @@ static struct amba_device *amba_devs[] __initdata = {static struct platform_device *plat_devs[]__initdata = {/* spear3xx specific devices */ + &spear3xx_ehci_device, &spear3xx_i2c_device, + &spear3xx_ohci0_device, + &spear3xx_ohci1_device, &spear3xx_rtc_device,/* spear300 specific devices */
arch/arm/mach-spear3xx/spear310_evb.c +3 -0
@@ -87,7 +87,10 @@ static struct amba_device *amba_devs[] __initdata = {static struct platform_device *plat_devs[]__initdata = {/* spear3xx specific devices */ + &spear3xx_ehci_device, &spear3xx_i2c_device, + &spear3xx_ohci0_device, + &spear3xx_ohci1_device, &spear3xx_rtc_device,/* spear310 specific devices */
arch/arm/mach-spear3xx/spear320_evb.c +3 -0
@@ -81,7 +81,10 @@ static struct amba_device *amba_devs[] __initdata = {static struct platform_device *plat_devs[]__initdata = {/* spear3xx specific devices */ + &spear3xx_ehci_device, &spear3xx_i2c_device, + &spear3xx_ohci0_device, + &spear3xx_ohci1_device, &spear3xx_rtc_device,/* spear320 specific devices */
arch/arm/mach-spear3xx/spear3xx.c +77 -0
83 lines not on this page · raw message
arch/arm/mach-spear6xx/include/mach/generic.h +4 -0
@@ -32,7 +32,11 @@extern struct amba_device gpio_device[];extern struct amba_device uart_device[];extern struct amba_device wdt_device; +extern struct platform_device ehci0_device; +extern struct platform_device ehci1_device;extern struct platform_device i2c_device; +extern struct platform_device ohci0_device; +extern struct platform_device ohci1_device;extern struct platform_device rtc_device;extern struct sys_timer spear6xx_timer;
arch/arm/mach-spear6xx/spear600_evb.c +4 -0
@@ -26,7 +26,11 @@ static struct amba_device *amba_devs[] __initdata = { };static struct platform_device *plat_devs[]__initdata = { + &ehci0_device, + &ehci1_device, &i2c_device, + &ohci0_device, + &ohci1_device, &rtc_device, };
arch/arm/mach-spear6xx/spear6xx.c +108 -0
114 lines not on this page · raw message
Signature · 1 line
1.7.2.2
PATCH v6 12/17 ST SPEAr: Adding machine support for keyboard
In reply to Viresh KumarFrom: Rajeev Kumar <[email protected]>
--- arch/arm/mach-spear13xx/include/mach/generic.h | 1 + arch/arm/mach-spear13xx/spear1300_evb.c | 20 ++++++++++++++++++++ arch/arm/mach-spear13xx/spear1310_evb.c | 20 ++++++++++++++++++++ arch/arm/mach-spear13xx/spear13xx.c | 19 +++++++++++++++++++ arch/arm/mach-spear3xx/include/mach/generic.h | 1 + arch/arm/mach-spear3xx/spear300.c | 19 +++++++++++++++++++ arch/arm/mach-spear3xx/spear300_evb.c | 20 ++++++++++++++++++++ arch/arm/plat-spear/include/plat/keyboard.h | 7 ------- 8 files changed, 100 insertions(+), 7 deletions(-)
arch/arm/mach-spear13xx/include/mach/generic.h +1 -0
@@ -226,6 +226,7 @@ extern struct amba_device spear13xx_uart_device;extern struct platform_device spear13xx_ehci0_device;extern struct platform_device spear13xx_ehci1_device;extern struct platform_device spear13xx_i2c_device; +extern struct platform_device spear13xx_kbd_device;extern struct platform_device spear13xx_ohci0_device;extern struct platform_device spear13xx_ohci1_device;extern struct platform_device spear13xx_rtc_device;
arch/arm/mach-spear13xx/spear1300_evb.c +20 -0
@@ -14,6 +14,7 @@#include <linux/types.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> +#include <plat/keyboard.h> #include <mach/generic.h> #include <mach/hardware.h> #include <mach/pcie.h>
@@ -47,11 +48,24 @@ static struct platform_device *plat_devs[] __initdata = { &spear13xx_ehci0_device, &spear13xx_ehci1_device, &spear13xx_i2c_device, + &spear13xx_kbd_device, &spear13xx_ohci0_device, &spear13xx_ohci1_device, &spear13xx_rtc_device, }; +/* keyboard specific platform data */ +static const __initconst DECLARE_KEYMAP (keymap); +static const struct matrix_keymap_data keymap_data__initconst = { + .keymap = keymap, + .keymap_size =ARRAY_SIZE (keymap), +}; + +static const struct kbd_platform_data kbd_data__initconst = { + .keymap = &keymap_data, + .rep =1 , +}; +#ifdef CONFIG_PCIEPORTBUS /* * This function is needed for PCIE host and device driver. Same
@@ -83,6 +97,12 @@ static void __init spear1300_evb_init(void)/* call spear1300 machine init function */ spear1300_init (NULL , pmx_devs,ARRAY_SIZE (pmx_devs)); +/* set keyboard plat data */ +if (platform_device_add_data (&spear13xx_kbd_device, &kbd_data, +sizeof (kbd_data))) +printk (KERN_WARNING "%s: couldn't add plat_data" , + spear13xx_kbd_device.name); +#ifdef CONFIG_PCIEPORTBUS /* Enable PCIE0 clk */ enable_pcie0_clk ();
arch/arm/mach-spear13xx/spear1310_evb.c +20 -0
@@ -14,6 +14,7 @@#include <linux/types.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> +#include <plat/keyboard.h> #include <mach/generic.h> #include <mach/hardware.h> #include <mach/pcie.h>
@@ -62,6 +63,7 @@ static struct platform_device *plat_devs[] __initdata = { &spear13xx_ehci0_device, &spear13xx_ehci1_device, &spear13xx_i2c_device, + &spear13xx_kbd_device, &spear13xx_ohci0_device, &spear13xx_ohci1_device, &spear13xx_rtc_device,
@@ -72,6 +74,18 @@ static struct platform_device *plat_devs[] __initdata = { &spear1310_i2c1_device, }; +/* keyboard specific platform data */ +static const __initconst DECLARE_KEYMAP (keymap); +static const struct matrix_keymap_data keymap_data__initconst = { + .keymap = keymap, + .keymap_size =ARRAY_SIZE (keymap), +}; + +static const struct kbd_platform_data kbd_data__initconst = { + .keymap = &keymap_data, + .rep =1 , +}; +#ifdef CONFIG_PCIEPORTBUS /* * This function is needed for PCIE host and device driver. Same
@@ -103,6 +117,12 @@ static void __init spear1310_evb_init(void)/* call spear1310 machine init function */ spear1310_init (NULL , pmx_devs,ARRAY_SIZE (pmx_devs)); +/* set keyboard plat data */ +if (platform_device_add_data (&spear13xx_kbd_device, &kbd_data, +sizeof (kbd_data))) +printk (KERN_WARNING "%s: couldn't add plat_data" , + spear13xx_kbd_device.name); +#ifdef CONFIG_PCIEPORTBUS /* Enable PCIE0 clk */ enable_pcie0_clk ();
arch/arm/mach-spear13xx/spear13xx.c +19 -0
@@ -204,6 +204,25 @@ struct platform_device spear13xx_ohci1_device = { .resource = ohci1_resources, }; +/* keyboard device registration */ +static struct resource kbd_resources[] = { + { + .start =SPEAR13XX_KBD_BASE , + .end =SPEAR13XX_KBD_BASE +SZ_1K -1 , + .flags =IORESOURCE_MEM , + }, { + .start =IRQ_KBD , + .flags =IORESOURCE_IRQ , + }, +}; + +struct platform_device spear13xx_kbd_device = { + .name ="keyboard" , + .id =-1 , + .num_resources =ARRAY_SIZE (kbd_resources), + .resource = kbd_resources, +}; +/* rtc device registration */ static struct resource rtc_resources[] = { {
arch/arm/mach-spear3xx/include/mach/generic.h +1 -0
@@ -107,6 +107,7 @@ extern struct pmx_dev spear3xx_pmx_plgpio_45_46_49_50;#ifdef CONFIG_MACH_SPEAR300 /* Add spear300 machine device structure declarations here */ extern struct amba_device spear300_gpio1_device; +extern struct platform_device spear300_kbd_device;/* pad mux modes */ extern struct pmx_mode spear300_nand_mode;
arch/arm/mach-spear3xx/spear300.c +19 -0
@@ -595,6 +595,25 @@ struct amba_device spear300_gpio1_device = { .irq = {SPEAR300_VIRQ_GPIO1, NO_IRQ}, }; +/* keyboard device registration */ +static struct resource kbd_resources[] = { + { + .start =SPEAR300_KEYBOARD_BASE , + .end =SPEAR300_KEYBOARD_BASE +SZ_1K -1 , + .flags =IORESOURCE_MEM , + }, { + .start =SPEAR300_VIRQ_KEYBOARD , + .flags =IORESOURCE_IRQ , + }, +}; + +struct platform_device spear300_kbd_device = { + .name ="keyboard" , + .id =-1 , + .num_resources =ARRAY_SIZE (kbd_resources), + .resource = kbd_resources, +}; +/* spear300 routines */ void __init spear300_init (struct pmx_mode *pmx_mode,struct pmx_dev **pmx_devs,u8 pmx_dev_count)
arch/arm/mach-spear3xx/spear300_evb.c +20 -0
@@ -13,6 +13,7 @@#include <asm/mach/arch.h> #include <asm/mach-types.h> +#include <plat/keyboard.h> #include <mach/generic.h> #include <mach/hardware.h>
@@ -51,6 +52,19 @@ static struct platform_device *plat_devs[] __initdata = { &spear3xx_rtc_device,/* spear300 specific devices */ + &spear300_kbd_device, +}; + +/* keyboard specific platform data */ +static const __initconst DECLARE_KEYMAP (keymap); +static const struct matrix_keymap_data keymap_data__initconst = { + .keymap = keymap, + .keymap_size =ARRAY_SIZE (keymap), +}; + +static const struct kbd_platform_data kbd_data__initconst = { + .keymap = &keymap_data, + .rep =1 , };static void __init spear300_evb_init (void )
@@ -61,6 +75,12 @@ static void __init spear300_evb_init(void)spear300_init (&spear300_photo_frame_mode, pmx_devs,ARRAY_SIZE (pmx_devs)); +/* set keyboard plat data */ +if (platform_device_add_data (&spear300_kbd_device, &kbd_data, +sizeof (kbd_data))) +printk (KERN_WARNING "%s: couldn't add plat_data" , + spear300_kbd_device.name); +/* Register slave devices on the I2C buses */ i2c_register_default_devices ();
arch/arm/plat-spear/include/plat/keyboard.h +0 -7
@@ -131,11 +131,4 @@ struct kbd_platform_data { bool rep; }; -/* This function is used to set platform data field of pdev->dev */ -static inline void -kbd_set_plat_data (struct platform_device *pdev,struct kbd_platform_data *data) -{ - pdev->dev.platform_data = data; -} -#endif /* __PLAT_KEYBOARD_H */
Signature · 1 line
1.7.2.2
PATCH v6 13/17 ST SPEAr: Adding machine support for nand
In reply to Viresh KumarFrom: Vipin Kumar <[email protected]>
--- arch/arm/mach-spear13xx/include/mach/generic.h | 3 + arch/arm/mach-spear13xx/spear1300_evb.c | 17 +++++ arch/arm/mach-spear13xx/spear1310_evb.c | 17 +++++ arch/arm/mach-spear13xx/spear13xx.c | 53 +++++++++++++++ arch/arm/mach-spear3xx/include/mach/generic.h | 6 ++ arch/arm/mach-spear3xx/spear300.c | 85 ++++++++++++++++++++++++ arch/arm/mach-spear3xx/spear300_evb.c | 15 ++++ arch/arm/mach-spear3xx/spear310.c | 22 ++++++ arch/arm/mach-spear3xx/spear310_evb.c | 15 ++++ arch/arm/mach-spear3xx/spear320.c | 22 ++++++ arch/arm/mach-spear3xx/spear320_evb.c | 15 ++++ arch/arm/mach-spear6xx/include/mach/generic.h | 1 + arch/arm/mach-spear6xx/spear600_evb.c | 15 ++++ arch/arm/mach-spear6xx/spear6xx.c | 22 ++++++ 14 files changed, 308 insertions(+), 0 deletions(-)
arch/arm/mach-spear13xx/include/mach/generic.h +3 -0
@@ -227,6 +227,7 @@ extern struct platform_device spear13xx_ehci0_device;extern struct platform_device spear13xx_ehci1_device;extern struct platform_device spear13xx_i2c_device;extern struct platform_device spear13xx_kbd_device; +extern struct platform_device spear13xx_nand_device;extern struct platform_device spear13xx_ohci0_device;extern struct platform_device spear13xx_ohci1_device;extern struct platform_device spear13xx_rtc_device;
@@ -239,6 +240,8 @@ void __init spear_setup_timer(void);void __init spear13xx_map_io (void );void __init spear13xx_init_irq (void );void __init spear13xx_init (void ); +void __init nand_mach_init (u32 busw); +void nand_select_bank (u32 bank,u32 busw);void spear13xx_secondary_startup (void );/* spear1300 declarations */
arch/arm/mach-spear13xx/spear1300_evb.c +17 -0
@@ -12,6 +12,8 @@*/ #include <linux/types.h> +#include <linux/mtd/nand.h> +#include <linux/mtd/fsmc.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> #include <plat/keyboard.h>
@@ -49,11 +51,19 @@ static struct platform_device *plat_devs[] __initdata = { &spear13xx_ehci1_device, &spear13xx_i2c_device, &spear13xx_kbd_device, + &spear13xx_nand_device, &spear13xx_ohci0_device, &spear13xx_ohci1_device, &spear13xx_rtc_device, }; +/* fsmc platform data */ +static const struct fsmc_nand_platform_data nand_plat_data__initconst = { + .select_bank = nand_select_bank, + .options =NAND_SKIP_BBTSCAN , + .width =FSMC_NAND_BW8 , +}; +/* keyboard specific platform data */ static const __initconst DECLARE_KEYMAP (keymap); static const struct matrix_keymap_data keymap_data __initconst = {
@@ -97,6 +107,13 @@ static void __init spear1300_evb_init(void)/* call spear1300 machine init function */ spear1300_init (NULL , pmx_devs,ARRAY_SIZE (pmx_devs)); +/* set nand device's plat data */ +nand_mach_init (FSMC_NAND_BW8 ); +if (platform_device_add_data (&spear13xx_nand_device, &nand_plat_data, +sizeof (nand_plat_data))) +printk (KERN_WARNING "%s: couldn't add plat_data" , + spear13xx_nand_device.name); +/* set keyboard plat data */ if (platform_device_add_data (&spear13xx_kbd_device, &kbd_data,sizeof (kbd_data)))
arch/arm/mach-spear13xx/spear1310_evb.c +17 -0
@@ -12,6 +12,8 @@*/ #include <linux/types.h> +#include <linux/mtd/nand.h> +#include <linux/mtd/fsmc.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> #include <plat/keyboard.h>
@@ -64,6 +66,7 @@ static struct platform_device *plat_devs[] __initdata = { &spear13xx_ehci1_device, &spear13xx_i2c_device, &spear13xx_kbd_device, + &spear13xx_nand_device, &spear13xx_ohci0_device, &spear13xx_ohci1_device, &spear13xx_rtc_device,
@@ -74,6 +77,13 @@ static struct platform_device *plat_devs[] __initdata = { &spear1310_i2c1_device, }; +/* fsmc platform data */ +static const struct fsmc_nand_platform_data nand_plat_data__initconst = { + .select_bank = nand_select_bank, + .options =NAND_SKIP_BBTSCAN , + .width =FSMC_NAND_BW8 , +}; +/* keyboard specific platform data */ static const __initconst DECLARE_KEYMAP (keymap);static const struct matrix_keymap_data keymap_data__initconst = {
@@ -117,6 +127,13 @@ static void __init spear1310_evb_init(void)/* call spear1310 machine init function */ spear1310_init (NULL , pmx_devs,ARRAY_SIZE (pmx_devs)); +/* set nand device's plat data */ +nand_mach_init (FSMC_NAND_BW8 ); +if (platform_device_add_data (&spear13xx_nand_device, &nand_plat_data, +sizeof (nand_plat_data))) +printk (KERN_WARNING "%s: couldn't add plat_data" , + spear13xx_nand_device.name); +/* set keyboard plat data */ if (platform_device_add_data (&spear13xx_kbd_device, &kbd_data,sizeof (kbd_data)))
arch/arm/mach-spear13xx/spear13xx.c +53 -0
71 lines not on this page · raw message
arch/arm/mach-spear3xx/include/mach/generic.h +6 -0
@@ -108,6 +108,10 @@ extern struct pmx_dev spear3xx_pmx_plgpio_45_46_49_50;/* Add spear300 machine device structure declarations here */ extern struct amba_device spear300_gpio1_device;extern struct platform_device spear300_kbd_device; +extern struct platform_device spear300_nand0_device; +extern struct platform_device spear300_nand1_device; +extern struct platform_device spear300_nand2_device; +extern struct platform_device spear300_nand3_device;/* pad mux modes */ extern struct pmx_mode spear300_nand_mode;
@@ -158,6 +162,7 @@ extern struct amba_device spear310_uart2_device;extern struct amba_device spear310_uart3_device;extern struct amba_device spear310_uart4_device;extern struct amba_device spear310_uart5_device; +extern struct platform_device spear310_nand_device;extern struct platform_device spear310_plgpio_device;/* pad mux devices */
@@ -185,6 +190,7 @@ extern struct amba_device spear320_uart2_device;extern struct platform_device spear320_can0_device;extern struct platform_device spear320_can1_device;extern struct platform_device spear320_i2c1_device; +extern struct platform_device spear320_nand_device;extern struct platform_device spear320_plgpio_device;extern struct platform_device spear320_pwm_device;
arch/arm/mach-spear3xx/spear300.c +85 -0
91 lines not on this page · raw message
arch/arm/mach-spear3xx/spear300_evb.c +15 -0
@@ -11,6 +11,8 @@* warranty of any kind, whether express or implied. */ +#include <linux/mtd/nand.h> +#include <linux/mtd/fsmc.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> #include <plat/keyboard.h>
@@ -53,6 +55,13 @@ static struct platform_device *plat_devs[] __initdata = {/* spear300 specific devices */ &spear300_kbd_device, + &spear300_nand0_device, +}; + +/* fsmc platform data */ +static const struct fsmc_nand_platform_data nand0_plat_data__initconst = { + .options =NAND_SKIP_BBTSCAN , + .width =FSMC_NAND_BW8 , };/* keyboard specific platform data */
@@ -75,6 +84,12 @@ static void __init spear300_evb_init(void)spear300_init (&spear300_photo_frame_mode, pmx_devs,ARRAY_SIZE (pmx_devs)); +/* set nand0 device's plat data */ +if (platform_device_add_data (&spear300_nand0_device, &nand0_plat_data, +sizeof (nand0_plat_data))) +printk (KERN_WARNING "%s: couldn't add plat_data" , + spear300_nand0_device.name); +/* set keyboard plat data */ if (platform_device_add_data (&spear300_kbd_device, &kbd_data,sizeof (kbd_data)))
arch/arm/mach-spear3xx/spear310.c +22 -0
@@ -374,6 +374,28 @@ struct amba_device spear310_uart5_device = { .irq = {SPEAR310_VIRQ_UART5, NO_IRQ}, }; +/* nand device registeration */ +static struct resource nand_resources[] = { + { + .name ="nand_data" , + .start =SPEAR310_NAND_BASE , + .end =SPEAR310_NAND_BASE +SZ_16 -1 , + .flags =IORESOURCE_MEM , + }, { + .name ="fsmc_regs" , + .start =SPEAR310_FSMC_BASE , + .end =SPEAR310_FSMC_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, +}; + +struct platform_device spear310_nand_device = { + .name ="fsmc-nand" , + .id =-1 , + .resource = nand_resources, + .num_resources =ARRAY_SIZE (nand_resources), +}; +/* plgpio device registeration */ /* * pin to offset and offset to pin converter functions
arch/arm/mach-spear3xx/spear310_evb.c +15 -0
@@ -11,6 +11,8 @@* warranty of any kind, whether express or implied. */ +#include <linux/mtd/nand.h> +#include <linux/mtd/fsmc.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> #include <mach/emi.h>
@@ -95,9 +97,16 @@ static struct platform_device *plat_devs[] __initdata = {/* spear310 specific devices */ &spear310_emi_nor_device, + &spear310_nand_device, &spear310_plgpio_device, }; +/* fsmc platform data */ +static const struct fsmc_nand_platform_data nand_plat_data__initconst = { + .options =NAND_SKIP_BBTSCAN , + .width =FSMC_NAND_BW8 , +}; +static void __init spear310_evb_init (void ) {unsigned int i;
@@ -108,6 +117,12 @@ static void __init spear310_evb_init(void)/* Initialize emi regiters */ emi_init (SPEAR310_EMI_REG_BASE ,0 ,EMI_FLASH_WIDTH32 ); +/* set nand device's plat data */ +if (platform_device_add_data (&spear310_nand_device, &nand_plat_data, +sizeof (nand_plat_data))) +printk (KERN_WARNING "%s: couldn't add plat_data" , + spear310_nand_device.name); +/* Register slave devices on the I2C buses */ i2c_register_default_devices ();
arch/arm/mach-spear3xx/spear320.c +22 -0
@@ -797,6 +797,28 @@ struct platform_device spear320_i2c1_device = { .resource = i2c1_resources, }; +/* nand device registeration */ +static struct resource nand_resources[] = { + { + .name ="nand_data" , + .start =SPEAR320_NAND_BASE , + .end =SPEAR320_NAND_BASE +SZ_16 -1 , + .flags =IORESOURCE_MEM , + }, { + .name ="fsmc_regs" , + .start =SPEAR320_FSMC_BASE , + .end =SPEAR320_FSMC_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, +}; + +struct platform_device spear320_nand_device = { + .name ="fsmc-nand" , + .id =-1 , + .resource = nand_resources, + .num_resources =ARRAY_SIZE (nand_resources), +}; +/* plgpio device registeration */ static struct plgpio_platform_data plgpio_plat_data = { .gpio_base =8 ,
arch/arm/mach-spear3xx/spear320_evb.c +15 -0
@@ -11,6 +11,8 @@* warranty of any kind, whether express or implied. */ +#include <linux/mtd/nand.h> +#include <linux/mtd/fsmc.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> #include <mach/emi.h>
@@ -92,10 +94,17 @@ static struct platform_device *plat_devs[] __initdata = { &spear320_can1_device, &spear320_i2c1_device, &spear320_emi_nor_device, + &spear320_nand_device, &spear320_plgpio_device, &spear320_pwm_device, }; +/* fsmc platform data */ +static const struct fsmc_nand_platform_data nand_plat_data__initconst = { + .options =NAND_SKIP_BBTSCAN , + .width =FSMC_NAND_BW8 , +}; +static void __init spear320_evb_init (void ) {unsigned int i;
@@ -107,6 +116,12 @@ static void __init spear320_evb_init(void)/* Initialize emi regiters */ emi_init (SPEAR320_EMI_CTRL_BASE ,0 ,EMI_FLASH_WIDTH16 ); +/* set nand device's plat data */ +if (platform_device_add_data (&spear320_nand_device, &nand_plat_data, +sizeof (nand_plat_data))) +printk (KERN_WARNING "%s: couldn't add plat_data" , + spear320_nand_device.name); +/* Register slave devices on the I2C buses */ i2c_register_default_devices ();
arch/arm/mach-spear6xx/include/mach/generic.h +1 -0
@@ -35,6 +35,7 @@ extern struct amba_device wdt_device;extern struct platform_device ehci0_device;extern struct platform_device ehci1_device;extern struct platform_device i2c_device; +extern struct platform_device nand_device;extern struct platform_device ohci0_device;extern struct platform_device ohci1_device;extern struct platform_device rtc_device;
arch/arm/mach-spear6xx/spear600_evb.c +15 -0
@@ -11,6 +11,8 @@* warranty of any kind, whether express or implied. */ +#include <linux/mtd/nand.h> +#include <linux/mtd/fsmc.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> #include <mach/generic.h>
@@ -31,13 +33,26 @@ static struct platform_device *plat_devs[] __initdata = { &i2c_device, &ohci0_device, &ohci1_device, + &nand_device, &rtc_device, }; +/* fsmc platform data */ +static const struct fsmc_nand_platform_data nand_plat_data__initconst = { + .options =NAND_SKIP_BBTSCAN , + .width =FSMC_NAND_BW8 , +}; +static void __init spear600_evb_init (void ) {unsigned int i; +/* set nand device's plat data */ +if (platform_device_add_data (&nand_device, &nand_plat_data, +sizeof (nand_plat_data))) +printk (KERN_WARNING "%s: couldn't add plat_data" , + nand_device.name); +/* call spear600 machine init function */ spear600_init ();
arch/arm/mach-spear6xx/spear6xx.c +22 -0
@@ -133,6 +133,28 @@ struct platform_device i2c_device = { .resource = i2c_resources, }; +/* nand device registeration */ +static struct resource nand_resources[] = { + { + .name ="nand_data" , + .start =SPEAR6XX_ICM1_NAND_BASE , + .end =SPEAR6XX_ICM1_NAND_BASE +SZ_16 -1 , + .flags =IORESOURCE_MEM , + }, { + .name ="fsmc_regs" , + .start =SPEAR6XX_ICM1_FSMC_BASE , + .end =SPEAR6XX_ICM1_FSMC_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, +}; + +struct platform_device nand_device = { + .name ="fsmc-nand" , + .id =-1 , + .resource = nand_resources, + .num_resources =ARRAY_SIZE (nand_resources), +}; +/* usb host device registeration */ static struct resource ehci0_resources[] = { [0 ] = {
Signature · 1 line
1.7.2.2
PATCH v6 14/17 ST SPEAr: Adding support for SSP PL022
In reply to Viresh Kumar--- arch/arm/mach-spear13xx/include/mach/generic.h | 1 + arch/arm/mach-spear13xx/spear1300_evb.c | 10 +++ arch/arm/mach-spear13xx/spear1310_evb.c | 10 +++ arch/arm/mach-spear13xx/spear13xx.c | 31 ++++++++++ arch/arm/mach-spear3xx/include/mach/generic.h | 2 + arch/arm/mach-spear3xx/spear300_evb.c | 25 ++++++++ arch/arm/mach-spear3xx/spear310_evb.c | 37 ++++++++++++ arch/arm/mach-spear3xx/spear320.c | 42 +++++++++++++ arch/arm/mach-spear3xx/spear320_evb.c | 13 ++++ arch/arm/mach-spear3xx/spear3xx.c | 31 ++++++++++ arch/arm/mach-spear6xx/include/mach/generic.h | 1 + arch/arm/mach-spear6xx/spear600_evb.c | 12 ++++ arch/arm/mach-spear6xx/spear6xx.c | 68 ++++++++++++++++++++++ arch/arm/plat-spear/include/plat/spi.h | 74 ++++++++++++++++++++++++ 14 files changed, 357 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-spear/include/plat/spi.h
arch/arm/mach-spear13xx/include/mach/generic.h +1 -0
@@ -222,6 +222,7 @@ extern struct pmx_dev pmx_uart1_modem;/* Add spear13xx family device structure declarations here */ extern struct amba_device spear13xx_gpio_device[]; +extern struct amba_device spear13xx_ssp_device;extern struct amba_device spear13xx_uart_device;extern struct platform_device spear13xx_ehci0_device;extern struct platform_device spear13xx_ehci1_device;
arch/arm/mach-spear13xx/spear1300_evb.c +10 -0
@@ -12,11 +12,15 @@*/ #include <linux/types.h> +#include <linux/gpio.h> #include <linux/mtd/nand.h> +#include <linux/spi/flash.h> +#include <linux/spi/spi.h> #include <linux/mtd/fsmc.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> #include <plat/keyboard.h> +#include <plat/spi.h> #include <mach/generic.h> #include <mach/hardware.h> #include <mach/pcie.h>
@@ -43,6 +47,7 @@ static struct pmx_dev *pmx_devs[] = {static struct amba_device *amba_devs[]__initdata = { &spear13xx_gpio_device[0 ], &spear13xx_gpio_device[1 ], + &spear13xx_ssp_device, &spear13xx_uart_device, };
@@ -76,6 +81,9 @@ static const struct kbd_platform_data kbd_data __initconst = { .rep = 1, }; +static struct spi_board_info __initdata spi_board_info[] = { +}; +#ifdef CONFIG_PCIEPORTBUS /* * This function is needed for PCIE host and device driver. Same
@@ -129,6 +137,8 @@ static void __init spear1300_evb_init(void)/* Register slave devices on the I2C buses */ i2c_register_default_devices (); +spi_register_board_info (spi_board_info,ARRAY_SIZE (spi_board_info)); +/* Add Platform Devices */ platform_add_devices (plat_devs,ARRAY_SIZE (plat_devs));
arch/arm/mach-spear13xx/spear1310_evb.c +10 -0
@@ -12,11 +12,15 @@*/ #include <linux/types.h> +#include <linux/gpio.h> #include <linux/mtd/nand.h> +#include <linux/spi/flash.h> +#include <linux/spi/spi.h> #include <linux/mtd/fsmc.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> #include <plat/keyboard.h> +#include <plat/spi.h> #include <mach/generic.h> #include <mach/hardware.h> #include <mach/pcie.h>
@@ -50,6 +54,7 @@ static struct amba_device *amba_devs[] __initdata = {/* spear13xx specific devices */ &spear13xx_gpio_device[0 ], &spear13xx_gpio_device[1 ], + &spear13xx_ssp_device, &spear13xx_uart_device,/* spear1310 specific devices */
@@ -96,6 +101,9 @@ static const struct kbd_platform_data kbd_data __initconst = { .rep = 1, }; +static struct spi_board_info __initdata spi_board_info[] = { +}; +#ifdef CONFIG_PCIEPORTBUS /* * This function is needed for PCIE host and device driver. Same
@@ -152,6 +160,8 @@ static void __init spear1310_evb_init(void)/* Add Platform Devices */ platform_add_devices (plat_devs,ARRAY_SIZE (plat_devs)); +spi_register_board_info (spi_board_info,ARRAY_SIZE (spi_board_info)); +/* Add Amba Devices */ for (i =0 ; i <ARRAY_SIZE (amba_devs); i++)amba_device_register (amba_devs[i], &iomem_resource);
arch/arm/mach-spear13xx/spear13xx.c +31 -0
@@ -12,6 +12,7 @@*/ #include <linux/types.h> +#include <linux/amba/pl022.h> #include <linux/amba/pl061.h> #include <linux/ptrace.h> #include <linux/io.h>
@@ -65,6 +66,36 @@ struct amba_device spear13xx_gpio_device[] = { } }; +/* ssp device registeration */ +static struct pl022_ssp_controller ssp_platform_data = { + .bus_id =0 , + .enable_dma =0 , +/* +* This is number of spi devices that can be connected to spi. There are +* two type of chipselects on which slave devices can work. One is chip +* select provided by spi masters other is controlled through external +* gpio's. We can't use chipselect provided from spi master (because as +* soon as FIFO becomes empty, CS is disabled and transfer ends). So +* this number now depends on number of gpios available for spi. each +* slave on each master requires a separate gpio pin. +*/ + .num_chipselect =2 , +}; + +struct amba_device spear13xx_ssp_device = { + .dev = { + .coherent_dma_mask = ~0 , + .init_name ="ssp-pl022" , + .platform_data = &ssp_platform_data, + }, + .res = { + .start =SPEAR13XX_SSP_BASE , + .end =SPEAR13XX_SSP_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, + .irq = {IRQ_SSP ,NO_IRQ }, +}; +/* uart device registeration */ struct amba_device spear13xx_uart_device = { .dev = {
arch/arm/mach-spear3xx/include/mach/generic.h +2 -0
@@ -32,6 +32,7 @@/* Add spear3xx family device structure declarations here */ extern struct amba_device spear3xx_gpio_device; +extern struct amba_device spear3xx_ssp0_device;extern struct amba_device spear3xx_uart_device;extern struct amba_device spear3xx_wdt_device;extern struct platform_device spear3xx_ehci_device;
@@ -185,6 +186,7 @@ void __init spear310_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,/* spear320 declarations */ #ifdef CONFIG_MACH_SPEAR320 /* Add spear320 machine device structure declarations here */ +extern struct amba_device spear320_ssp_device[];extern struct amba_device spear320_uart1_device;extern struct amba_device spear320_uart2_device;extern struct platform_device spear320_can0_device;
arch/arm/mach-spear3xx/spear300_evb.c +25 -0
@@ -11,11 +11,15 @@* warranty of any kind, whether express or implied. */ +#include <linux/gpio.h> #include <linux/mtd/nand.h> #include <linux/mtd/fsmc.h> +#include <linux/spi/flash.h> +#include <linux/spi/spi.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> #include <plat/keyboard.h> +#include <plat/spi.h> #include <mach/generic.h> #include <mach/hardware.h>
@@ -38,6 +42,7 @@ static struct pmx_dev *pmx_devs[] = {static struct amba_device *amba_devs[]__initdata = {/* spear3xx specific devices */ &spear3xx_gpio_device, + &spear3xx_ssp0_device, &spear3xx_uart_device, &spear3xx_wdt_device,
@@ -76,6 +81,24 @@ static const struct kbd_platform_data kbd_data __initconst = { .rep = 1, }; +/* spi board information */ +/* spi0 flash Chip Select Control function, controlled by gpio pin mentioned */ +DECLARE_SPI_CS_CONTROL (0 , flash,RAS_GPIO_3 ); +/* spi0 flash Chip Info structure */ +DECLARE_SPI_CHIP_INFO (0 , flash, spi0_flash_cs_control); + +static struct spi_board_info __initdata spi_board_info[] = { +/* spi0 board info */ + { + .modalias ="m25p80" , + .controller_data = &spi0_flash_chip_info, + .max_speed_hz =25000000 , + .bus_num =0 , + .chip_select =1 , + .mode =SPI_MODE_1 , + } +}; +static void __init spear300_evb_init (void ) {unsigned int i;
@@ -99,6 +122,8 @@ static void __init spear300_evb_init(void)/* Register slave devices on the I2C buses */ i2c_register_default_devices (); +spi_register_board_info (spi_board_info,ARRAY_SIZE (spi_board_info)); +/* Add Platform Devices */ platform_add_devices (plat_devs,ARRAY_SIZE (plat_devs));
arch/arm/mach-spear3xx/spear310_evb.c +37 -0
@@ -11,10 +11,14 @@* warranty of any kind, whether express or implied. */ +#include <linux/gpio.h> #include <linux/mtd/nand.h> #include <linux/mtd/fsmc.h> +#include <linux/spi/flash.h> +#include <linux/spi/spi.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> +#include <plat/spi.h> #include <mach/emi.h> #include <mach/generic.h> #include <mach/hardware.h>
@@ -76,6 +80,7 @@ static struct pmx_dev *pmx_devs[] = {static struct amba_device *amba_devs[]__initdata = {/* spear3xx specific devices */ &spear3xx_gpio_device, + &spear3xx_ssp0_device, &spear3xx_uart_device, &spear3xx_wdt_device,
@@ -107,6 +112,36 @@ static const struct fsmc_nand_platform_data nand_plat_data __initconst = { .width = FSMC_NAND_BW8, }; +/* spi board information */ +/* spi0 flash Chip Select Control function, controlled by gpio pin mentioned */ +DECLARE_SPI_CS_CONTROL (0 , flash,BASIC_GPIO_3 ); +/* spi0 flash Chip Info structure */ +DECLARE_SPI_CHIP_INFO (0 , flash, spi0_flash_cs_control); + +/* spi0 spidev Chip Select Control function, controlled by gpio pin mentioned */ +DECLARE_SPI_CS_CONTROL (0 , dev,BASIC_GPIO_4 ); +/* spi0 spidev Chip Info structure */ +DECLARE_SPI_CHIP_INFO (0 , dev, spi0_dev_cs_control); + +static struct spi_board_info __initdata spi_board_info[] = { +/* spi0 board info */ + { + .modalias ="spidev" , + .controller_data = &spi0_dev_chip_info, + .max_speed_hz =25000000 , + .bus_num =0 , + .chip_select =0 , + .mode =SPI_MODE_1 , + }, { + .modalias ="m25p80" , + .controller_data = &spi0_flash_chip_info, + .max_speed_hz =25000000 , + .bus_num =0 , + .chip_select =1 , + .mode =SPI_MODE_1 , + } +}; +static void __init spear310_evb_init (void ) {unsigned int i;
@@ -126,6 +161,8 @@ static void __init spear310_evb_init(void)/* Register slave devices on the I2C buses */ i2c_register_default_devices (); +spi_register_board_info (spi_board_info,ARRAY_SIZE (spi_board_info)); +/* Add Platform Devices */ platform_add_devices (plat_devs,ARRAY_SIZE (plat_devs));
arch/arm/mach-spear3xx/spear320.c +42 -0
54 lines not on this page · raw message
arch/arm/mach-spear3xx/spear320_evb.c +13 -0
@@ -11,10 +11,14 @@* warranty of any kind, whether express or implied. */ +#include <linux/gpio.h> #include <linux/mtd/nand.h> #include <linux/mtd/fsmc.h> +#include <linux/spi/flash.h> +#include <linux/spi/spi.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> +#include <plat/spi.h> #include <mach/emi.h> #include <mach/generic.h> #include <mach/hardware.h>
@@ -73,10 +77,13 @@ static struct pmx_dev *pmx_devs[] = {static struct amba_device *amba_devs[]__initdata = {/* spear3xx specific devices */ &spear3xx_gpio_device, + &spear3xx_ssp0_device, &spear3xx_uart_device, &spear3xx_wdt_device,/* spear320 specific devices */ + &spear320_ssp_device[0 ], + &spear320_ssp_device[1 ], &spear320_uart1_device, &spear320_uart2_device, };
@@ -105,6 +112,10 @@ static const struct fsmc_nand_platform_data nand_plat_data __initconst = { .width = FSMC_NAND_BW8, }; +/* spi board information */ +static struct spi_board_info __initdata spi_board_info[] = { +}; +static void __init spear320_evb_init (void ) {unsigned int i;
@@ -125,6 +136,8 @@ static void __init spear320_evb_init(void)/* Register slave devices on the I2C buses */ i2c_register_default_devices (); +spi_register_board_info (spi_board_info,ARRAY_SIZE (spi_board_info)); +/* Add Platform Devices */ platform_add_devices (plat_devs,ARRAY_SIZE (plat_devs));
arch/arm/mach-spear3xx/spear3xx.c +31 -0
@@ -12,6 +12,7 @@*/ #include <linux/types.h> +#include <linux/amba/pl022.h> #include <linux/amba/pl061.h> #include <linux/ptrace.h> #include <linux/io.h>
@@ -41,6 +42,36 @@ struct amba_device spear3xx_gpio_device = { .irq = {SPEAR3XX_IRQ_BASIC_GPIO, NO_IRQ}, }; +/* ssp device registration */ +static struct pl022_ssp_controller ssp_platform_data = { + .bus_id = 0, + .enable_dma = 0, + /* + * This is number of spi devices that can be connected to spi. There are + * two type of chipselects on which slave devices can work. One is chip + * select provided by spi masters other is controlled through external + * gpio's. We can't use chipselect provided from spi master (because as + * soon as FIFO becomes empty, CS is disabled and transfer ends). So + * this number now depends on number of gpios available for spi. each + * slave on each master requires a separate gpio pin. + */ + .num_chipselect = 2, +}; + +struct amba_device spear3xx_ssp0_device = { + .dev = { + .coherent_dma_mask = ~0, + .init_name = "ssp-pl022.0", + .platform_data = &ssp_platform_data, + }, + .res = { + .start = SPEAR3XX_ICM1_SSP_BASE, + .end = SPEAR3XX_ICM1_SSP_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + .irq = {SPEAR3XX_IRQ_SSP, NO_IRQ}, +}; + /* uart device registration */ struct amba_device spear3xx_uart_device = { .dev = {
arch/arm/mach-spear6xx/include/mach/generic.h +1 -0
@@ -30,6 +30,7 @@/* Add spear6xx family device structure declarations here */ extern struct amba_device gpio_device[]; +extern struct amba_device ssp_device[];extern struct amba_device uart_device[];extern struct amba_device wdt_device;extern struct platform_device ehci0_device;
arch/arm/mach-spear6xx/spear600_evb.c +12 -0
@@ -11,10 +11,14 @@* warranty of any kind, whether express or implied. */ +#include <linux/gpio.h> #include <linux/mtd/nand.h> #include <linux/mtd/fsmc.h> +#include <linux/spi/flash.h> +#include <linux/spi/spi.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> +#include <plat/spi.h> #include <mach/generic.h> #include <mach/hardware.h>
@@ -22,6 +26,9 @@ static struct amba_device *amba_devs[] __initdata = { &gpio_device[0 ], &gpio_device[1 ], &gpio_device[2 ], + &ssp_device[0 ], + &ssp_device[1 ], + &ssp_device[2 ], &uart_device[0 ], &uart_device[1 ], &wdt_device,
@@ -43,6 +50,9 @@ static const struct fsmc_nand_platform_data nand_plat_data __initconst = { .width = FSMC_NAND_BW8, }; +static struct spi_board_info __initdata spi_board_info[] = { +}; +static void __init spear600_evb_init (void ) {unsigned int i;
@@ -59,6 +69,8 @@ static void __init spear600_evb_init(void)/* Register slave devices on the I2C buses */ i2c_register_default_devices (); +spi_register_board_info (spi_board_info,ARRAY_SIZE (spi_board_info)); +/* Add Platform Devices */ platform_add_devices (plat_devs,ARRAY_SIZE (plat_devs));
arch/arm/mach-spear6xx/spear6xx.c +68 -0
80 lines not on this page · raw message
arch/arm/plat-spear/include/plat/spi.h new file +74 -0
74 lines not on this page · raw message
Signature · 1 line
1.7.2.2
PATCH v6 15/17 ST SPEAr: Adding support for SDHCI (SDIO)
In reply to Viresh Kumar--- arch/arm/mach-spear13xx/include/mach/generic.h | 1 + arch/arm/mach-spear13xx/spear1300_evb.c | 1 + arch/arm/mach-spear13xx/spear1310_evb.c | 1 + arch/arm/mach-spear13xx/spear13xx.c | 34 +++++++++++++++++++ arch/arm/mach-spear3xx/include/mach/generic.h | 6 +++ arch/arm/mach-spear3xx/spear300.c | 42 ++++++++++++++++++++++++ arch/arm/mach-spear3xx/spear300_evb.c | 16 +++++++++ arch/arm/mach-spear3xx/spear320.c | 23 +++++++++++++ arch/arm/mach-spear3xx/spear320_evb.c | 13 +++++++ 9 files changed, 137 insertions(+), 0 deletions(-)
arch/arm/mach-spear13xx/include/mach/generic.h +1 -0
@@ -232,6 +232,7 @@ extern struct platform_device spear13xx_nand_device;extern struct platform_device spear13xx_ohci0_device;extern struct platform_device spear13xx_ohci1_device;extern struct platform_device spear13xx_rtc_device; +extern struct platform_device spear13xx_sdhci_device;extern struct sys_timer spear13xx_timer;/* Add spear13xx family function declarations here */
arch/arm/mach-spear13xx/spear1300_evb.c +1 -0
@@ -60,6 +60,7 @@ static struct platform_device *plat_devs[] __initdata = { &spear13xx_ohci0_device, &spear13xx_ohci1_device, &spear13xx_rtc_device, + &spear13xx_sdhci_device, };/* fsmc platform data */
arch/arm/mach-spear13xx/spear1310_evb.c +1 -0
@@ -75,6 +75,7 @@ static struct platform_device *plat_devs[] __initdata = { &spear13xx_ohci0_device, &spear13xx_ohci1_device, &spear13xx_rtc_device, + &spear13xx_sdhci_device,/* spear1310 specific devices */ &spear1310_can0_device,
arch/arm/mach-spear13xx/spear13xx.c +34 -0
@@ -326,6 +326,38 @@ struct platform_device spear13xx_rtc_device = { .resource = rtc_resources, }; +/* sdhci (sdio) device declaration */ +static struct resource sdhci_resources[] = { + { + .start =SPEAR13XX_MCIF_SDHCI_BASE , + .end =SPEAR13XX_MCIF_SDHCI_BASE +SZ_256 -1 , + .flags =IORESOURCE_MEM , + }, { + .start =IRQ_SDHCI , + .flags =IORESOURCE_IRQ , + } +}; + +struct platform_device spear13xx_sdhci_device = { + .dev = { + .coherent_dma_mask = ~0 , + }, + .name ="sdhci" , + .id =-1 , + .num_resources =ARRAY_SIZE (sdhci_resources), + .resource = sdhci_resources, +}; + +static void sdhci_enable (void ) +{ +unsigned val =readl (PERIP_CFG ); + +/* This function enables SD/MMC interface out of SD/MMC, CF, XD */ + val &= ~(MCIF_SEL_MASK <<MCIF_SEL_SHIFT ); + val |=SD_MMC_ACTIVE <<MCIF_SEL_SHIFT ; +writel (val,PERIP_CFG ); +} +#ifdef CONFIG_PCIEPORTBUS /* PCIE0 clock always needs to be enabled if any of the three PCIE port * have to be used. So call this function from the board initilization
@@ -367,6 +399,8 @@ void __init spear13xx_init(void)*/ l2x0_init (__io_address (SPEAR13XX_L2CC_BASE ),0x00260249 ,0xfe00ffff );#endif + +sdhci_enable (); }/* This will initialize vic */
arch/arm/mach-spear3xx/include/mach/generic.h +6 -0
@@ -113,6 +113,7 @@ extern struct platform_device spear300_nand0_device;extern struct platform_device spear300_nand1_device;extern struct platform_device spear300_nand2_device;extern struct platform_device spear300_nand3_device; +extern struct platform_device spear300_sdhci_device;/* pad mux modes */ extern struct pmx_mode spear300_nand_mode;
@@ -152,6 +153,10 @@ extern struct pmx_dev spear300_pmx_gpio1;/* Add spear300 machine function declarations here */ void __init spear300_init (struct pmx_mode *pmx_mode,struct pmx_dev **pmx_devs,u8 pmx_dev_count); +#define SDHCI_MEM_ENB 0x1 +#define I2S_MEM_ENB 0x2 +#define SDHCI_MEM_SELECT 0x20000000 +void sdhci_i2s_mem_enable (u8 mask);#endif /* CONFIG_MACH_SPEAR300 */
@@ -195,6 +200,7 @@ extern struct platform_device spear320_i2c1_device;extern struct platform_device spear320_nand_device;extern struct platform_device spear320_plgpio_device;extern struct platform_device spear320_pwm_device; +extern struct platform_device spear320_sdhci_device;/* pad mux modes */ extern struct pmx_mode spear320_auto_net_smii_mode;
arch/arm/mach-spear3xx/spear300.c +42 -0
48 lines not on this page · raw message
arch/arm/mach-spear3xx/spear300_evb.c +16 -0
@@ -12,6 +12,7 @@*/ #include <linux/gpio.h> +#include <linux/mmc/sdhci-spear.h> #include <linux/mtd/nand.h> #include <linux/mtd/fsmc.h> #include <linux/spi/flash.h>
@@ -61,6 +62,15 @@ static struct platform_device *plat_devs[] __initdata = {/* spear300 specific devices */ &spear300_kbd_device, &spear300_nand0_device, + &spear300_sdhci_device, +}; + +/* sdhci board specific information */ +static struct sdhci_plat_data sdhci_plat_data = { + .card_power_gpio =RAS_GPIO_2 , + .power_active_high =0 , + .power_always_enb =0 , + .card_int_gpio =RAS_GPIO_0 , };/* fsmc platform data */
@@ -122,6 +132,12 @@ static void __init spear300_evb_init(void)/* Register slave devices on the I2C buses */ i2c_register_default_devices (); +/* set sdhci device platform data */ +sdhci_set_plat_data (&spear300_sdhci_device, &sdhci_plat_data); + +/* Enable sdhci memory */ +sdhci_i2s_mem_enable (SDHCI_MEM_ENB ); +spi_register_board_info (spi_board_info,ARRAY_SIZE (spi_board_info));/* Add Platform Devices */
arch/arm/mach-spear3xx/spear320.c +23 -0
@@ -13,6 +13,7 @@#include <linux/amba/pl022.h> #include <linux/ptrace.h> +#include <linux/mmc/sdhci-spear.h> #include <asm/irq.h> #include <plat/gpio.h> #include <plat/shirq.h>
@@ -905,6 +906,28 @@ struct platform_device spear320_pwm_device = { .resource = pwm_resources, }; +/* sdhci (sdio) device registeration */ +static struct resource sdhci_resources[] = { + { + .start =SPEAR320_SDHCI_BASE , + .end =SPEAR320_SDHCI_BASE +SZ_256 -1 , + .flags =IORESOURCE_MEM , + }, { + .start =SPEAR320_IRQ_SDHCI , + .flags =IORESOURCE_IRQ , + } +}; + +struct platform_device spear320_sdhci_device = { + .dev = { + .coherent_dma_mask = ~0 , + }, + .name ="sdhci" , + .id =-1 , + .num_resources =ARRAY_SIZE (sdhci_resources), + .resource = sdhci_resources, +}; +/* spear320 routines */ void __init spear320_init (struct pmx_mode *pmx_mode,struct pmx_dev **pmx_devs,u8 pmx_dev_count)
arch/arm/mach-spear3xx/spear320_evb.c +13 -0
@@ -15,6 +15,7 @@#include <linux/mtd/nand.h> #include <linux/mtd/fsmc.h> #include <linux/spi/flash.h> +#include <linux/mmc/sdhci-spear.h> #include <linux/spi/spi.h> #include <asm/mach/arch.h> #include <asm/mach-types.h>
@@ -104,6 +105,15 @@ static struct platform_device *plat_devs[] __initdata = { &spear320_nand_device, &spear320_plgpio_device, &spear320_pwm_device, + &spear320_sdhci_device, +}; + +/* sdhci board specific information */ +static struct sdhci_plat_data sdhci_plat_data = { + .card_power_gpio =PLGPIO_61 , + .power_active_high =0 , + .power_always_enb =1 , + .card_int_gpio =-1 , };/* fsmc platform data */
@@ -133,6 +143,9 @@ static void __init spear320_evb_init(void)printk (KERN_WARNING "%s: couldn't add plat_data" , spear320_nand_device.name); +/* set sdhci device platform data */ +sdhci_set_plat_data (&spear320_sdhci_device, &sdhci_plat_data); +/* Register slave devices on the I2C buses */ i2c_register_default_devices ();
Signature · 1 line
1.7.2.2
PATCH v6 16/17 ST SPEAr Power Management: Added the support for Standby mode.
In reply to Viresh KumarFrom: Deepak Sikri <[email protected]>
Open Points:
-> Suspend to RAM support needs to be added. -> SPEAr13xx: The power domains need to be added. -> For SPEAr13xx: PLL-4 has not been switch off while moving into sleep. There is some problem in getting the pll back to on.
--- arch/arm/mach-spear13xx/Makefile | 1 + arch/arm/mach-spear13xx/include/mach/suspend.h | 47 +++ arch/arm/mach-spear13xx/pm.c | 107 ++++++ arch/arm/mach-spear13xx/sleep.S | 435 ++++++++++++++++++++++++ arch/arm/mach-spear13xx/spear13xx.c | 5 + arch/arm/mach-spear3xx/include/mach/suspend.h | 44 +++ arch/arm/mach-spear3xx/spear3xx.c | 7 +- arch/arm/mach-spear6xx/include/mach/suspend.h | 44 +++ arch/arm/mach-spear6xx/spear6xx.c | 9 +- arch/arm/plat-spear/Makefile | 6 + arch/arm/plat-spear/pm.c | 104 ++++++ arch/arm/plat-spear/sleep.S | 288 ++++++++++++++++ 12 files changed, 1095 insertions(+), 2 deletions(-) create mode 100644 arch/arm/mach-spear13xx/include/mach/suspend.h create mode 100644 arch/arm/mach-spear13xx/pm.c create mode 100644 arch/arm/mach-spear13xx/sleep.S create mode 100644 arch/arm/mach-spear3xx/include/mach/suspend.h create mode 100644 arch/arm/mach-spear6xx/include/mach/suspend.h create mode 100644 arch/arm/plat-spear/pm.c create mode 100644 arch/arm/plat-spear/sleep.S
arch/arm/mach-spear13xx/Makefile +1 -0
@@ -8,6 +8,7 @@ obj-$(CONFIG_SMP) += platsmp.o headsmp.o obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o obj-$(CONFIG_PCIEPORTBUS) += pcie.o +obj-$(CONFIG_PM) += pm.o sleep.o # spear1300 specific files obj-$(CONFIG_MACH_SPEAR1300) += spear1300.o
arch/arm/mach-spear13xx/include/mach/suspend.h new file +47 -0
47 lines not on this page · raw message
arch/arm/mach-spear13xx/pm.c new file +107 -0
107 lines not on this page · raw message
arch/arm/mach-spear13xx/sleep.S new file +435 -0
435 lines not on this page · raw message
arch/arm/mach-spear13xx/spear13xx.c +5 -0
@@ -439,6 +439,11 @@ struct map_desc spear13xx_io_desc[] __initdata = { .pfn = __phys_to_pfn(SPEAR13XX_SYSRAM0_BASE), .length = SZ_32K, .type = MT_DEVICE + }, { + .virtual = IO_ADDRESS(SPEAR13XX_SYSRAM1_BASE), + .pfn = __phys_to_pfn(SPEAR13XX_SYSRAM1_BASE), + .length = SZ_1M, + .type = MT_MEMORY_NONCACHED }, };
arch/arm/mach-spear3xx/include/mach/suspend.h new file +44 -0
44 lines not on this page · raw message
arch/arm/mach-spear3xx/spear3xx.c +6 -1
@@ -22,6 +22,10 @@#include <mach/generic.h> #include <mach/hardware.h> +#define SPEAR3XX_WKUP_SRCS (1 << SPEAR3XX_IRQ_MAC_1 | 1 << \ + SPEAR3XX_IRQ_USB_DEV | 1 << SPEAR3XX_IRQ_BASIC_RTC | 1 << \ + SPEAR3XX_IRQ_BASIC_GPIO) +/* Add spear3xx machines common devices here */ /* gpio device registration */ static struct pl061_platform_data gpio_plat_data = {
@@ -224,7 +228,8 @@ void __init spear3xx_init(void)/* This will initialize vic */ void __init spear3xx_init_irq (void ) { -vic_init ((void __iomem *)VA_SPEAR3XX_ML1_VIC_BASE ,0 , ~0 ,0 ); +vic_init ((void __iomem *)VA_SPEAR3XX_ML1_VIC_BASE ,0 , ~0 , +SPEAR3XX_WKUP_SRCS ); }/* Following will create static virtual/physical mappings */
arch/arm/mach-spear6xx/include/mach/suspend.h new file +44 -0
44 lines not on this page · raw message
arch/arm/mach-spear6xx/spear6xx.c +8 -1
@@ -23,6 +23,12 @@#include <mach/hardware.h> #include <mach/irqs.h> +/* The wake sources are routed through vic-2 */ +#define SPEAR6XX_WKUP_SRCS_VIC2 (1 << (IRQ_GMAC_1 - 32) | \ + 1 << (IRQ_USB_DEV - 32) | \ + 1 << (IRQ_BASIC_RTC - 32) |\ + 1 << (IRQ_BASIC_GPIO - 32)) +/* Add spear6xx machines common devices here */ /* ssp device registration */ static struct pl022_ssp_controller ssp_platform_data[] = {
@@ -360,7 +366,8 @@ void __init spear6xx_init(void)void __init spear6xx_init_irq (void ) {vic_init ((void __iomem *)VA_SPEAR6XX_CPU_VIC_PRI_BASE ,0 , ~0 ,0 ); -vic_init ((void __iomem *)VA_SPEAR6XX_CPU_VIC_SEC_BASE ,32 , ~0 ,0 ); +vic_init ((void __iomem *)VA_SPEAR6XX_CPU_VIC_SEC_BASE ,32 , ~0 , +SPEAR6XX_WKUP_SRCS_VIC2 ); }/* Following will create static virtual/physical mappings */
arch/arm/plat-spear/Makefile +6 -0
@@ -7,6 +7,7 @@ obj-y := clock.o time.o obj-$(CONFIG_ARCH_SPEAR13XX) += padmux.o obj-$(CONFIG_ARCH_SPEAR3XX) += shirq.o padmux.o + obj-$(CONFIG_MACH_SPEAR310) += plgpio.o obj-$(CONFIG_MACH_SPEAR320) += plgpio.o
@@ -18,3 +19,8 @@ obj-$(CONFIG_BOARD_SPEAR300_EVB) += i2c_eval_board.o obj-$(CONFIG_BOARD_SPEAR310_EVB) += i2c_eval_board.o obj-$(CONFIG_BOARD_SPEAR320_EVB) += i2c_eval_board.o obj-$(CONFIG_BOARD_SPEAR600_EVB) += i2c_eval_board.o + +ifeq ($(CONFIG_PM),y) +obj-$(CONFIG_ARCH_SPEAR3XX) += pm.o sleep.o +obj-$(CONFIG_ARCH_SPEAR6XX) += pm.o sleep.o +endif
arch/arm/plat-spear/pm.c new file +104 -0
104 lines not on this page · raw message
arch/arm/plat-spear/sleep.S new file +288 -0
288 lines not on this page · raw message
Signature · 1 line
1.7.2.2
PATCH v6 17/17 ST SPEAr: Updating defconfigs
In reply to Viresh Kumar--- arch/arm/configs/spear13xx_defconfig | 78 ++++++++++++++++++++++++++++++--- arch/arm/configs/spear3xx_defconfig | 80 +++++++++++++++++++++++++++++++--- arch/arm/configs/spear6xx_defconfig | 72 ++++++++++++++++++++++++++++--- 3 files changed, 211 insertions(+), 19 deletions(-)
arch/arm/configs/spear13xx_defconfig +72 -6
@@ -10,31 +10,94 @@ CONFIG_PLAT_SPEAR=y CONFIG_ARCH_SPEAR13XX=y CONFIG_BOARD_SPEAR1300_EVB=y CONFIG_BOARD_SPEAR1310_EVB=y +CONFIG_PCI=y +CONFIG_PCI_MSI=y +CONFIG_PCIEPORTBUS=y +# CONFIG_PCIEAER is not set CONFIG_SMP=y CONFIG_NR_CPUS=2 CONFIG_AEABI=y +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_STAT_DETAILS=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_USERSPACE=y +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y +CONFIG_VFP=y CONFIG_BINFMT_MISC=y +CONFIG_PM=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +CONFIG_NET_IPIP=y +CONFIG_ARPD=y +# CONFIG_IPV6 is not set +# CONFIG_WIRELESS is not set CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y CONFIG_MTD=y CONFIG_MTD_CONCAT=y CONFIG_MTD_PARTITIONS=y CONFIG_MTD_CMDLINE_PARTS=y CONFIG_MTD_CHAR=y CONFIG_MTD_BLOCK=y +CONFIG_MTD_CFI=y +CONFIG_MTD_CFI_INTELEXT=y +CONFIG_MTD_CFI_STAA=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_M25P80=y +# CONFIG_M25PXX_USE_FAST_READ is not set +CONFIG_MTD_NAND=y +CONFIG_MTD_NAND_FSMC=y CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=16384 +CONFIG_SCSI=y +CONFIG_BLK_DEV_SD=y +CONFIG_CHR_DEV_ST=y +CONFIG_CHR_DEV_OSST=y +CONFIG_BLK_DEV_SR=y +CONFIG_CHR_DEV_SG=y +CONFIG_CHR_DEV_SCH=y +CONFIG_NETDEVICES=y +# CONFIG_WLAN is not set CONFIG_INPUT_FF_MEMLESS=y # CONFIG_INPUT_MOUSEDEV_PSAUX is not set -# CONFIG_INPUT_KEYBOARD is not set +CONFIG_INPUT_EVDEV=y +CONFIG_INPUT_EVBUG=y +# CONFIG_KEYBOARD_ATKBD is not set +CONFIG_KEYBOARD_SPEAR=y # CONFIG_INPUT_MOUSE is not set CONFIG_SERIAL_AMBA_PL011=y CONFIG_SERIAL_AMBA_PL011_CONSOLE=y # CONFIG_LEGACY_PTYS is not set CONFIG_RAW_DRIVER=y CONFIG_MAX_RAW_DEVS=8192 +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_DESIGNWARE=y +CONFIG_SPI=y +CONFIG_SPI_PL022=y +CONFIG_SPI_SPIDEV=y +CONFIG_GPIO_SYSFS=y +CONFIG_GPIO_PL061=y # CONFIG_HWMON is not set # CONFIG_HID_SUPPORT is not set -# CONFIG_USB_SUPPORT is not set +CONFIG_USB=y +CONFIG_USB_EHCI_HCD=y +# CONFIG_USB_EHCI_TT_NEWSCHED is not set +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_STORAGE=y +CONFIG_USB_TEST=y +CONFIG_MMC=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_SPEAR=y +CONFIG_RTC_CLASS=y CONFIG_EXT2_FS=y CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_SECURITY=y
@@ -42,16 +105,18 @@ CONFIG_EXT3_FS=y # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set CONFIG_EXT3_FS_SECURITY=y CONFIG_AUTOFS4_FS=m -CONFIG_MSDOS_FS=m -CONFIG_VFAT_FS=m +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y CONFIG_FAT_DEFAULT_IOCHARSET="ascii" CONFIG_TMPFS=y CONFIG_JFFS2_FS=y +CONFIG_NFS_FS=y +CONFIG_ROOT_NFS=y +# CONFIG_RPCSEC_GSS_KRB5 is not set CONFIG_PARTITION_ADVANCED=y -CONFIG_NLS=y CONFIG_NLS_DEFAULT="utf8" CONFIG_NLS_CODEPAGE_437=y -CONFIG_NLS_ASCII=m +CONFIG_NLS_ASCII=y CONFIG_MAGIC_SYSRQ=y CONFIG_DEBUG_FS=y CONFIG_DEBUG_KERNEL=y
@@ -59,3 +124,4 @@ CONFIG_DETECT_HUNG_TASK=y CONFIG_DEBUG_SPINLOCK=y CONFIG_DEBUG_SPINLOCK_SLEEP=y CONFIG_DEBUG_INFO=y +# CONFIG_ARM_UNWIND is not set
arch/arm/configs/spear3xx_defconfig +73 -7
116 lines not on this page · raw message
arch/arm/configs/spear6xx_defconfig +66 -6
106 lines not on this page · raw message
Signature · 1 line
1.7.2.2