Commit fbd62710 authored by Daniel Silverstone's avatar Daniel Silverstone Committed by Ben Dooks

[ARM] KS8695: Fix up device registration.

The KS8695 device.c provides registration functionality for the
KS8695's various devices such as watchdog timers and ethernet
devices. Rather than predicating those on the config options for the
drivers, always register the platform devices so that a later built
module can hook on. Also, the ethernet used to register virtual
addresses in the platform data. This is wrong and so this patch
changes them to physical addresses and also passes in the
appropriate physical region for the PHY or Switch as appropriate.
Signed-off-by: default avatarDaniel Silverstone <dsilvers@simtec.co.uk>
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
parent 72aaf09f
...@@ -25,19 +25,20 @@ ...@@ -25,19 +25,20 @@
#include <mach/regs-wan.h> #include <mach/regs-wan.h>
#include <mach/regs-lan.h> #include <mach/regs-lan.h>
#include <mach/regs-hpna.h> #include <mach/regs-hpna.h>
#include <mach/regs-switch.h>
#include <mach/regs-misc.h>
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Ethernet * Ethernet
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
#if defined(CONFIG_ARM_KS8695_ETHER) || defined(CONFIG_ARM_KS8695_ETHER_MODULE)
static u64 eth_dmamask = 0xffffffffUL; static u64 eth_dmamask = 0xffffffffUL;
static struct resource ks8695_wan_resources[] = { static struct resource ks8695_wan_resources[] = {
[0] = { [0] = {
.start = KS8695_WAN_VA, .start = KS8695_WAN_PA,
.end = KS8695_WAN_VA + 0x00ff, .end = KS8695_WAN_PA + 0x00ff,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
...@@ -58,6 +59,12 @@ static struct resource ks8695_wan_resources[] = { ...@@ -58,6 +59,12 @@ static struct resource ks8695_wan_resources[] = {
.end = KS8695_IRQ_WAN_LINK, .end = KS8695_IRQ_WAN_LINK,
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
}, },
[4] = {
.name = "WAN PHY",
.start = KS8695_MISC_PA,
.end = KS8695_MISC_PA + 0x1f,
.flags = IORESOURCE_MEM,
},
}; };
static struct platform_device ks8695_wan_device = { static struct platform_device ks8695_wan_device = {
...@@ -74,8 +81,8 @@ static struct platform_device ks8695_wan_device = { ...@@ -74,8 +81,8 @@ static struct platform_device ks8695_wan_device = {
static struct resource ks8695_lan_resources[] = { static struct resource ks8695_lan_resources[] = {
[0] = { [0] = {
.start = KS8695_LAN_VA, .start = KS8695_LAN_PA,
.end = KS8695_LAN_VA + 0x00ff, .end = KS8695_LAN_PA + 0x00ff,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
...@@ -90,6 +97,12 @@ static struct resource ks8695_lan_resources[] = { ...@@ -90,6 +97,12 @@ static struct resource ks8695_lan_resources[] = {
.end = KS8695_IRQ_LAN_TX_STATUS, .end = KS8695_IRQ_LAN_TX_STATUS,
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
}, },
[3] = {
.name = "LAN SWITCH",
.start = KS8695_SWITCH_PA,
.end = KS8695_SWITCH_PA + 0x4f,
.flags = IORESOURCE_MEM,
},
}; };
static struct platform_device ks8695_lan_device = { static struct platform_device ks8695_lan_device = {
...@@ -106,8 +119,8 @@ static struct platform_device ks8695_lan_device = { ...@@ -106,8 +119,8 @@ static struct platform_device ks8695_lan_device = {
static struct resource ks8695_hpna_resources[] = { static struct resource ks8695_hpna_resources[] = {
[0] = { [0] = {
.start = KS8695_HPNA_VA, .start = KS8695_HPNA_PA,
.end = KS8695_HPNA_VA + 0x00ff, .end = KS8695_HPNA_PA + 0x00ff,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
[1] = { [1] = {
...@@ -149,18 +162,12 @@ void __init ks8696_add_device_hpna(void) ...@@ -149,18 +162,12 @@ void __init ks8696_add_device_hpna(void)
{ {
platform_device_register(&ks8695_hpna_device); platform_device_register(&ks8695_hpna_device);
} }
#else
void __init ks8695_add_device_wan(void) {}
void __init ks8695_add_device_lan(void) {}
void __init ks8696_add_device_hpna(void) {}
#endif
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Watchdog * Watchdog
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
#if defined(CONFIG_KS8695_WATCHDOG) || defined(CONFIG_KS8695_WATCHDOG_MODULE)
static struct platform_device ks8695_wdt_device = { static struct platform_device ks8695_wdt_device = {
.name = "ks8695_wdt", .name = "ks8695_wdt",
.id = -1, .id = -1,
...@@ -171,9 +178,6 @@ static void __init ks8695_add_device_watchdog(void) ...@@ -171,9 +178,6 @@ static void __init ks8695_add_device_watchdog(void)
{ {
platform_device_register(&ks8695_wdt_device); platform_device_register(&ks8695_wdt_device);
} }
#else
static void __init ks8695_add_device_watchdog(void) {}
#endif
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment