ARM: 6678/1: SPEAr: update padmux code

- compile padmux only for spear3xx
- padmux initialization code rearranged in evaluation board and machine
  files.

Reviewed-by: Stanley Miao <stanley.miao@windriver.com>
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
master
viresh kumar 12 years ago committed by Russell King
parent f9324a85c1
commit 53688c51e4
  1. 7
      arch/arm/mach-spear3xx/include/mach/generic.h
  2. 14
      arch/arm/mach-spear3xx/spear300.c
  3. 9
      arch/arm/mach-spear3xx/spear300_evb.c
  4. 11
      arch/arm/mach-spear3xx/spear310.c
  5. 9
      arch/arm/mach-spear3xx/spear310_evb.c
  6. 11
      arch/arm/mach-spear3xx/spear320.c
  7. 9
      arch/arm/mach-spear3xx/spear320_evb.c
  8. 21
      arch/arm/mach-spear3xx/spear3xx.c
  9. 4
      arch/arm/plat-spear/Makefile

@ -40,7 +40,6 @@ void __init clk_init(void);
void __init spear3xx_map_io(void);
void __init spear3xx_init_irq(void);
void __init spear3xx_init(void);
void spear_pmx_init(struct pmx_driver *pmx_driver, uint base, uint size);
/* pad mux declarations */
#define PMX_FIRDA_MASK (1 << 14)
@ -133,8 +132,6 @@ extern struct pmx_dev pmx_telecom_sdio_4bit;
extern struct pmx_dev pmx_telecom_sdio_8bit;
extern struct pmx_dev pmx_gpio1;
void spear300_pmx_init(void);
/* Add spear300 machine function declarations here */
void __init spear300_init(void);
@ -154,8 +151,6 @@ extern struct pmx_dev pmx_fsmc;
extern struct pmx_dev pmx_rs485_0_1;
extern struct pmx_dev pmx_tdm0;
void spear310_pmx_init(void);
/* Add spear310 machine function declarations here */
void __init spear310_init(void);
@ -195,8 +190,6 @@ extern struct pmx_dev pmx_smii0;
extern struct pmx_dev pmx_smii1;
extern struct pmx_dev pmx_i2c1;
void spear320_pmx_init(void);
/* Add spear320 machine function declarations here */
void __init spear320_init(void);

@ -459,10 +459,16 @@ void __init spear300_init(void)
if (ret)
printk(KERN_ERR "Error registering Shared IRQ\n");
}
}
void spear300_pmx_init(void)
{
spear_pmx_init(&pmx_driver, SPEAR300_SOC_CONFIG_BASE,
/* pmx initialization */
pmx_driver.base = ioremap(SPEAR300_SOC_CONFIG_BASE,
SPEAR300_SOC_CONFIG_SIZE);
if (pmx_driver.base) {
ret = pmx_register(&pmx_driver);
if (ret)
printk(KERN_ERR "padmux: registeration failed. err no"
": %d\n", ret);
/* Free Mapping, device selection already done */
iounmap(pmx_driver.base);
}
}

@ -51,14 +51,13 @@ static void __init spear300_evb_init(void)
{
unsigned int i;
/* call spear300 machine init function */
spear300_init();
/* padmux initialization */
/* padmux initialization, must be done before spear300_init */
pmx_driver.mode = &photo_frame_mode;
pmx_driver.devs = pmx_devs;
pmx_driver.devs_count = ARRAY_SIZE(pmx_devs);
spear300_pmx_init();
/* call spear300 machine init function */
spear300_init();
/* Add Platform Devices */
platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));

@ -293,10 +293,11 @@ void __init spear310_init(void)
if (ret)
printk(KERN_ERR "Error registering Shared IRQ 4\n");
}
}
void spear310_pmx_init(void)
{
spear_pmx_init(&pmx_driver, SPEAR310_SOC_CONFIG_BASE,
SPEAR310_SOC_CONFIG_SIZE);
/* pmx initialization */
pmx_driver.base = base;
ret = pmx_register(&pmx_driver);
if (ret)
printk(KERN_ERR "padmux: registeration failed. err no: %d\n",
ret);
}

@ -58,14 +58,13 @@ static void __init spear310_evb_init(void)
{
unsigned int i;
/* call spear310 machine init function */
spear310_init();
/* padmux initialization */
/* padmux initialization, must be done before spear310_init */
pmx_driver.mode = NULL;
pmx_driver.devs = pmx_devs;
pmx_driver.devs_count = ARRAY_SIZE(pmx_devs);
spear310_pmx_init();
/* call spear310 machine init function */
spear310_init();
/* Add Platform Devices */
platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));

@ -540,10 +540,11 @@ void __init spear320_init(void)
if (ret)
printk(KERN_ERR "Error registering Shared IRQ 4\n");
}
}
void spear320_pmx_init(void)
{
spear_pmx_init(&pmx_driver, SPEAR320_SOC_CONFIG_BASE,
SPEAR320_SOC_CONFIG_SIZE);
/* pmx initialization */
pmx_driver.base = base;
ret = pmx_register(&pmx_driver);
if (ret)
printk(KERN_ERR "padmux: registeration failed. err no: %d\n",
ret);
}

@ -55,14 +55,13 @@ static void __init spear320_evb_init(void)
{
unsigned int i;
/* call spear320 machine init function */
spear320_init();
/* padmux initialization */
/* padmux initialization, must be done before spear320_init */
pmx_driver.mode = &auto_net_mii_mode;
pmx_driver.devs = pmx_devs;
pmx_driver.devs_count = ARRAY_SIZE(pmx_devs);
spear320_pmx_init();
/* call spear320 machine init function */
spear320_init();
/* Add Platform Devices */
platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));

@ -525,24 +525,3 @@ struct pmx_dev pmx_plgpio_45_46_49_50 = {
};
#endif
/* spear padmux initialization function */
void spear_pmx_init(struct pmx_driver *pmx_driver, uint base, uint size)
{
int ret = 0;
/* pad mux initialization */
pmx_driver->base = ioremap(base, size);
if (!pmx_driver->base) {
ret = -ENOMEM;
goto pmx_fail;
}
ret = pmx_register(pmx_driver);
iounmap(pmx_driver->base);
pmx_fail:
if (ret)
printk(KERN_ERR "padmux: registration failed. err no: %d\n",
ret);
}

@ -3,6 +3,6 @@
#
# Common support
obj-y := clock.o padmux.o time.o
obj-y := clock.o time.o
obj-$(CONFIG_ARCH_SPEAR3XX) += shirq.o
obj-$(CONFIG_ARCH_SPEAR3XX) += shirq.o padmux.o

Loading…
Cancel
Save