2005-04-17 02:20:36 +04:00
|
|
|
/*
|
|
|
|
* linux/arch/arm/mach-sa1100/pleb.c
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/tty.h>
|
|
|
|
#include <linux/ioport.h>
|
2012-09-21 13:18:58 +04:00
|
|
|
#include <linux/platform_data/sa11x0-serial.h>
|
2005-10-29 22:07:23 +04:00
|
|
|
#include <linux/platform_device.h>
|
2006-07-02 01:32:38 +04:00
|
|
|
#include <linux/irq.h>
|
2008-09-06 15:10:45 +04:00
|
|
|
#include <linux/io.h>
|
2005-04-17 02:20:36 +04:00
|
|
|
#include <linux/mtd/partitions.h>
|
net: smc91x: use run-time configuration on all ARM machines
The smc91x driver traditionally gets configured at compile-time
for whichever hardware it runs on. This no longer works on
ARM as we continue to move to building all-in-one kernels.
Most ARM configurations with this driver already use run-time
configuration through DT or through platform_data, but a
few have not been converted yet.
I've checked all ARM boards that use this driver in their
legacy board files, and converted the ones that were using
compile-time configuration in smc91x.h to behave like the
other ones and provide the interrupt polarity along with
the MMIO configuration (width, stride) at platform device
creation time.
In particular, these combinations were previously selectable
in Kconfig but in fact broken:
- sa1100 assabet plus pleb
- msm combined with any other armv6/v7 platform
- pxa-idp combined with any non-DMA pxa variant
- LogicPD PXA270 combined with any other pxa
- nomadik combined with any other armv4/v5 platform,
e.g. versatile.
None of these seem critical enough to warrant a backport
to stable, but it would be nice to clean this up for good.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
----
I would like the patch to get merged through netdev, after
Robert and/or Linus have verified it on at least some hardware.
There are a few other non-ARM platforms using this driver,
I could do the same patch for those if we want to take
it further.
arch/arm/mach-msm/board-halibut.c | 8 ++++-
arch/arm/mach-msm/board-qsd8x50.c | 8 ++++-
arch/arm/mach-pxa/idp.c | 5 +++
arch/arm/mach-pxa/lpd270.c | 8 ++++-
arch/arm/mach-realview/core.c | 7 ++++
arch/arm/mach-realview/realview_eb.c | 2 +-
arch/arm/mach-sa1100/neponset.c | 6 ++++
arch/arm/mach-sa1100/pleb.c | 7 ++++
drivers/net/ethernet/smsc/smc91x.c | 9 +++--
drivers/net/ethernet/smsc/smc91x.h | 114 ++----------------------------------------------------------
10 files changed, 57 insertions(+), 117 deletions(-)
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-25 18:31:57 +03:00
|
|
|
#include <linux/smc91x.h>
|
2005-04-17 02:20:36 +04:00
|
|
|
|
2008-08-05 19:14:15 +04:00
|
|
|
#include <mach/hardware.h>
|
2005-04-17 02:20:36 +04:00
|
|
|
#include <asm/setup.h>
|
|
|
|
#include <asm/mach-types.h>
|
|
|
|
|
|
|
|
#include <asm/mach/arch.h>
|
|
|
|
#include <asm/mach/map.h>
|
|
|
|
#include <asm/mach/flash.h>
|
2008-08-05 19:14:15 +04:00
|
|
|
#include <mach/irqs.h>
|
2005-04-17 02:20:36 +04:00
|
|
|
|
|
|
|
#include "generic.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Ethernet IRQ mappings
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define PLEB_ETH0_P (0x20000300) /* Ethernet 0 in PCMCIA0 IO */
|
|
|
|
#define PLEB_ETH0_V (0xf6000300)
|
|
|
|
|
|
|
|
#define GPIO_ETH0_IRQ GPIO_GPIO(21)
|
|
|
|
#define GPIO_ETH0_EN GPIO_GPIO(26)
|
|
|
|
|
|
|
|
#define IRQ_GPIO_ETH0_IRQ IRQ_GPIO21
|
|
|
|
|
|
|
|
static struct resource smc91x_resources[] = {
|
2012-01-12 14:25:29 +04:00
|
|
|
[0] = DEFINE_RES_MEM(PLEB_ETH0_P, 0x04000000),
|
2005-04-17 02:20:36 +04:00
|
|
|
#if 0 /* Autoprobe instead, to get rising/falling edge characteristic right */
|
2012-01-12 14:25:29 +04:00
|
|
|
[1] = DEFINE_RES_IRQ(IRQ_GPIO_ETH0_IRQ),
|
2005-04-17 02:20:36 +04:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
net: smc91x: use run-time configuration on all ARM machines
The smc91x driver traditionally gets configured at compile-time
for whichever hardware it runs on. This no longer works on
ARM as we continue to move to building all-in-one kernels.
Most ARM configurations with this driver already use run-time
configuration through DT or through platform_data, but a
few have not been converted yet.
I've checked all ARM boards that use this driver in their
legacy board files, and converted the ones that were using
compile-time configuration in smc91x.h to behave like the
other ones and provide the interrupt polarity along with
the MMIO configuration (width, stride) at platform device
creation time.
In particular, these combinations were previously selectable
in Kconfig but in fact broken:
- sa1100 assabet plus pleb
- msm combined with any other armv6/v7 platform
- pxa-idp combined with any non-DMA pxa variant
- LogicPD PXA270 combined with any other pxa
- nomadik combined with any other armv4/v5 platform,
e.g. versatile.
None of these seem critical enough to warrant a backport
to stable, but it would be nice to clean this up for good.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
----
I would like the patch to get merged through netdev, after
Robert and/or Linus have verified it on at least some hardware.
There are a few other non-ARM platforms using this driver,
I could do the same patch for those if we want to take
it further.
arch/arm/mach-msm/board-halibut.c | 8 ++++-
arch/arm/mach-msm/board-qsd8x50.c | 8 ++++-
arch/arm/mach-pxa/idp.c | 5 +++
arch/arm/mach-pxa/lpd270.c | 8 ++++-
arch/arm/mach-realview/core.c | 7 ++++
arch/arm/mach-realview/realview_eb.c | 2 +-
arch/arm/mach-sa1100/neponset.c | 6 ++++
arch/arm/mach-sa1100/pleb.c | 7 ++++
drivers/net/ethernet/smsc/smc91x.c | 9 +++--
drivers/net/ethernet/smsc/smc91x.h | 114 ++----------------------------------------------------------
10 files changed, 57 insertions(+), 117 deletions(-)
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-25 18:31:57 +03:00
|
|
|
static struct smc91x_platdata smc91x_platdata = {
|
|
|
|
.flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
|
|
|
|
};
|
2005-04-17 02:20:36 +04:00
|
|
|
|
|
|
|
static struct platform_device smc91x_device = {
|
|
|
|
.name = "smc91x",
|
|
|
|
.id = 0,
|
|
|
|
.num_resources = ARRAY_SIZE(smc91x_resources),
|
|
|
|
.resource = smc91x_resources,
|
net: smc91x: use run-time configuration on all ARM machines
The smc91x driver traditionally gets configured at compile-time
for whichever hardware it runs on. This no longer works on
ARM as we continue to move to building all-in-one kernels.
Most ARM configurations with this driver already use run-time
configuration through DT or through platform_data, but a
few have not been converted yet.
I've checked all ARM boards that use this driver in their
legacy board files, and converted the ones that were using
compile-time configuration in smc91x.h to behave like the
other ones and provide the interrupt polarity along with
the MMIO configuration (width, stride) at platform device
creation time.
In particular, these combinations were previously selectable
in Kconfig but in fact broken:
- sa1100 assabet plus pleb
- msm combined with any other armv6/v7 platform
- pxa-idp combined with any non-DMA pxa variant
- LogicPD PXA270 combined with any other pxa
- nomadik combined with any other armv4/v5 platform,
e.g. versatile.
None of these seem critical enough to warrant a backport
to stable, but it would be nice to clean this up for good.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
----
I would like the patch to get merged through netdev, after
Robert and/or Linus have verified it on at least some hardware.
There are a few other non-ARM platforms using this driver,
I could do the same patch for those if we want to take
it further.
arch/arm/mach-msm/board-halibut.c | 8 ++++-
arch/arm/mach-msm/board-qsd8x50.c | 8 ++++-
arch/arm/mach-pxa/idp.c | 5 +++
arch/arm/mach-pxa/lpd270.c | 8 ++++-
arch/arm/mach-realview/core.c | 7 ++++
arch/arm/mach-realview/realview_eb.c | 2 +-
arch/arm/mach-sa1100/neponset.c | 6 ++++
arch/arm/mach-sa1100/pleb.c | 7 ++++
drivers/net/ethernet/smsc/smc91x.c | 9 +++--
drivers/net/ethernet/smsc/smc91x.h | 114 ++----------------------------------------------------------
10 files changed, 57 insertions(+), 117 deletions(-)
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-25 18:31:57 +03:00
|
|
|
.dev = {
|
2015-03-05 01:39:18 +03:00
|
|
|
.platform_data = &smc91x_platdata,
|
net: smc91x: use run-time configuration on all ARM machines
The smc91x driver traditionally gets configured at compile-time
for whichever hardware it runs on. This no longer works on
ARM as we continue to move to building all-in-one kernels.
Most ARM configurations with this driver already use run-time
configuration through DT or through platform_data, but a
few have not been converted yet.
I've checked all ARM boards that use this driver in their
legacy board files, and converted the ones that were using
compile-time configuration in smc91x.h to behave like the
other ones and provide the interrupt polarity along with
the MMIO configuration (width, stride) at platform device
creation time.
In particular, these combinations were previously selectable
in Kconfig but in fact broken:
- sa1100 assabet plus pleb
- msm combined with any other armv6/v7 platform
- pxa-idp combined with any non-DMA pxa variant
- LogicPD PXA270 combined with any other pxa
- nomadik combined with any other armv4/v5 platform,
e.g. versatile.
None of these seem critical enough to warrant a backport
to stable, but it would be nice to clean this up for good.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
----
I would like the patch to get merged through netdev, after
Robert and/or Linus have verified it on at least some hardware.
There are a few other non-ARM platforms using this driver,
I could do the same patch for those if we want to take
it further.
arch/arm/mach-msm/board-halibut.c | 8 ++++-
arch/arm/mach-msm/board-qsd8x50.c | 8 ++++-
arch/arm/mach-pxa/idp.c | 5 +++
arch/arm/mach-pxa/lpd270.c | 8 ++++-
arch/arm/mach-realview/core.c | 7 ++++
arch/arm/mach-realview/realview_eb.c | 2 +-
arch/arm/mach-sa1100/neponset.c | 6 ++++
arch/arm/mach-sa1100/pleb.c | 7 ++++
drivers/net/ethernet/smsc/smc91x.c | 9 +++--
drivers/net/ethernet/smsc/smc91x.h | 114 ++----------------------------------------------------------
10 files changed, 57 insertions(+), 117 deletions(-)
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-25 18:31:57 +03:00
|
|
|
},
|
2005-04-17 02:20:36 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct platform_device *devices[] __initdata = {
|
|
|
|
&smc91x_device,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Pleb's memory map
|
|
|
|
* has flash memory (typically 4 or 8 meg) selected by
|
|
|
|
* the two SA1100 lowest chip select outputs.
|
|
|
|
*/
|
|
|
|
static struct resource pleb_flash_resources[] = {
|
2012-01-12 14:25:29 +04:00
|
|
|
[0] = DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_8M),
|
|
|
|
[1] = DEFINE_RES_MEM(SA1100_CS1_PHYS, SZ_8M),
|
2005-04-17 02:20:36 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static struct mtd_partition pleb_partitions[] = {
|
|
|
|
{
|
|
|
|
.name = "blob",
|
2008-09-29 20:09:10 +04:00
|
|
|
.offset = 0,
|
2005-04-17 02:20:36 +04:00
|
|
|
.size = 0x00020000,
|
|
|
|
}, {
|
|
|
|
.name = "kernel",
|
2008-09-29 20:09:10 +04:00
|
|
|
.offset = MTDPART_OFS_APPEND,
|
2005-04-17 02:20:36 +04:00
|
|
|
.size = 0x000e0000,
|
|
|
|
}, {
|
|
|
|
.name = "rootfs",
|
2008-09-29 20:09:10 +04:00
|
|
|
.offset = MTDPART_OFS_APPEND,
|
2005-04-17 02:20:36 +04:00
|
|
|
.size = 0x00300000,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static struct flash_platform_data pleb_flash_data = {
|
|
|
|
.map_name = "cfi_probe",
|
|
|
|
.parts = pleb_partitions,
|
|
|
|
.nr_parts = ARRAY_SIZE(pleb_partitions),
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static void __init pleb_init(void)
|
|
|
|
{
|
2009-10-06 17:55:53 +04:00
|
|
|
sa11x0_register_mtd(&pleb_flash_data, pleb_flash_resources,
|
2005-04-17 02:20:36 +04:00
|
|
|
ARRAY_SIZE(pleb_flash_resources));
|
|
|
|
|
|
|
|
|
|
|
|
platform_add_devices(devices, ARRAY_SIZE(devices));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void __init pleb_map_io(void)
|
|
|
|
{
|
|
|
|
sa1100_map_io();
|
|
|
|
|
|
|
|
sa1100_register_uart(0, 3);
|
2008-11-26 22:58:43 +03:00
|
|
|
sa1100_register_uart(1, 1);
|
2005-04-17 02:20:36 +04:00
|
|
|
|
2008-11-26 22:58:43 +03:00
|
|
|
GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD);
|
|
|
|
GPDR |= GPIO_UART_TXD;
|
|
|
|
GPDR &= ~GPIO_UART_RXD;
|
|
|
|
PPAR |= PPAR_UPR;
|
2005-04-17 02:20:36 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Fix expansion memory timing for network card
|
|
|
|
*/
|
|
|
|
MECR = ((2<<10) | (2<<5) | (2<<0));
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Enable the SMC ethernet controller
|
|
|
|
*/
|
|
|
|
GPDR |= GPIO_ETH0_EN; /* set to output */
|
|
|
|
GPCR = GPIO_ETH0_EN; /* clear MCLK (enable smc) */
|
|
|
|
|
|
|
|
GPDR &= ~GPIO_ETH0_IRQ;
|
|
|
|
|
2011-03-24 15:25:22 +03:00
|
|
|
irq_set_irq_type(GPIO_ETH0_IRQ, IRQ_TYPE_EDGE_FALLING);
|
2005-04-17 02:20:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
MACHINE_START(PLEB, "PLEB")
|
2005-07-03 20:38:58 +04:00
|
|
|
.map_io = pleb_map_io,
|
2012-02-24 03:06:51 +04:00
|
|
|
.nr_irqs = SA1100_NR_IRQS,
|
2005-07-03 20:38:58 +04:00
|
|
|
.init_irq = sa1100_init_irq,
|
2012-11-08 23:40:59 +04:00
|
|
|
.init_time = sa1100_timer_init,
|
2005-04-17 02:20:36 +04:00
|
|
|
.init_machine = pleb_init,
|
2012-04-26 17:22:45 +04:00
|
|
|
.init_late = sa11x0_init_late,
|
2011-11-05 14:28:50 +04:00
|
|
|
.restart = sa11x0_restart,
|
2005-04-17 02:20:36 +04:00
|
|
|
MACHINE_END
|