Commit a6afe87f authored by Russell King's avatar Russell King

[ARM] Add platform_device-based partition and map information.

This adds platform_device-based partition and map information for
badge4, cerf, collie, h3600, hackkit and shannon SA1100 machine
types.
parent 85a94fa8
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <asm/hardware.h> #include <asm/hardware.h>
...@@ -27,6 +29,7 @@ ...@@ -27,6 +29,7 @@
#include <asm/arch/irqs.h> #include <asm/arch/irqs.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/flash.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/hardware/sa1111.h> #include <asm/hardware/sa1111.h>
#include <asm/mach/serial_sa1100.h> #include <asm/mach/serial_sa1100.h>
...@@ -80,6 +83,45 @@ static int __init badge4_sa1111_init(void) ...@@ -80,6 +83,45 @@ static int __init badge4_sa1111_init(void)
} }
/*
* 1 x Intel 28F320C3 Advanced+ Boot Block Flash (32 Mi bit)
* Eight 4 KiW Parameter Bottom Blocks (64 KiB)
* Sixty-three 32 KiW Main Blocks (4032 Ki b)
*
* <or>
*
* 1 x Intel 28F640C3 Advanced+ Boot Block Flash (64 Mi bit)
* Eight 4 KiW Parameter Bottom Blocks (64 KiB)
* One-hundred-twenty-seven 32 KiW Main Blocks (8128 Ki b)
*/
static struct mtd_partition badge4_partitions[] = {
{
.name = "BLOB boot loader",
.offset = 0,
.size = 0x0000A000
}, {
.name = "params",
.offset = MTDPART_OFS_APPEND,
.size = 0x00006000
}, {
.name = "root",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL
}
};
static struct flash_platform_data badge4_flash_data = {
.map_name = "cfi_probe",
.parts = badge4_partitions,
.nr_parts = ARRAY_SIZE(badge4_partitions),
};
static struct resource badge4_flash_resource = {
.start = SA1100_CS0_PHYS,
.end = SA1100_CS0_PHYS + SZ_64M - 1,
.flags = IORESOURCE_MEM,
};
static int five_v_on __initdata = 0; static int five_v_on __initdata = 0;
static int __init five_v_on_setup(char *ignore) static int __init five_v_on_setup(char *ignore)
...@@ -170,6 +212,9 @@ static int __init badge4_init(void) ...@@ -170,6 +212,9 @@ static int __init badge4_init(void)
/* maybe turn on 5v0 from the start */ /* maybe turn on 5v0 from the start */
badge4_set_5V(BADGE4_5V_INITIALLY, five_v_on); badge4_set_5V(BADGE4_5V_INITIALLY, five_v_on);
sa11x0_set_flash_data(badge4_flash_data, badge4_flash_resources,
ARRAY_SIZE(badge4_flash_resources);
return 0; return 0;
} }
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/hardware.h> #include <asm/hardware.h>
...@@ -22,6 +24,7 @@ ...@@ -22,6 +24,7 @@
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/flash.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/mach/serial_sa1100.h> #include <asm/mach/serial_sa1100.h>
...@@ -47,6 +50,48 @@ static struct platform_device *cerf_devices[] __initdata = { ...@@ -47,6 +50,48 @@ static struct platform_device *cerf_devices[] __initdata = {
&cerfuart2_device, &cerfuart2_device,
}; };
#ifdef CONFIG_SA1100_CERF_FLASH_32MB
# define CERF_FLASH_SIZE 0x02000000
#elif defined CONFIG_SA1100_CERF_FLASH_16MB
# define CERF_FLASH_SIZE 0x01000000
#elif defined CONFIG_SA1100_CERF_FLASH_8MB
# define CERF_FLASH_SIZE 0x00800000
#else
# error "Undefined flash size for CERF"
#endif
static struct mtd_partition cerf_partitions[] = {
{
.name = "Bootloader",
.size = 0x00020000,
.offset = 0x00000000,
}, {
.name = "Params",
.size = 0x00040000,
.offset = 0x00020000,
}, {
.name = "Kernel",
.size = 0x00100000,
.offset = 0x00060000,
}, {
.name = "Filesystem",
.size = CERF_FLASH_SIZE-0x00160000,
.offset = 0x00160000,
}
};
static struct flash_platform_data cerf_flash_data = {
.map_name = "cfi_probe",
.parts = cerf_partitions,
.nr_parts = ARRAY_SIZE(cerf_partitions),
};
static struct resource cerf_flash_resource = {
.start = SA1100_CS0_PHYS,
.end = SA1100_CS0_PHYS + SZ_32M - 1,
.flags = IORESOURCE_MEM,
};
static void __init cerf_init_irq(void) static void __init cerf_init_irq(void)
{ {
sa1100_init_irq(); sa1100_init_irq();
...@@ -71,26 +116,17 @@ static void __init cerf_map_io(void) ...@@ -71,26 +116,17 @@ static void __init cerf_map_io(void)
GPDR |= CERF_GPIO_CF_RESET; GPDR |= CERF_GPIO_CF_RESET;
} }
static int __init cerf_init(void) static void __init cerf_init(void)
{ {
int ret; platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices));
sa11x0_set_flash_data(&cerf_flash_data, &cerf_flash_resource, 1);
if (!machine_is_cerf())
return -ENODEV;
ret = platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices));
if (ret < 0)
return ret;
return 0;
} }
arch_initcall(cerf_init);
MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube") MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
MAINTAINER("support@intrinsyc.com") MAINTAINER("support@intrinsyc.com")
BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
MAPIO(cerf_map_io) MAPIO(cerf_map_io)
INITIRQ(cerf_init_irq) INITIRQ(cerf_init_irq)
.timer = &sa1100_timer, .timer = &sa1100_timer,
.init_machine = cerf_init,
MACHINE_END MACHINE_END
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <asm/hardware.h> #include <asm/hardware.h>
...@@ -31,6 +33,7 @@ ...@@ -31,6 +33,7 @@
#include <asm/arch/collie.h> #include <asm/arch/collie.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/flash.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/mach/serial_sa1100.h> #include <asm/mach/serial_sa1100.h>
...@@ -89,6 +92,48 @@ static struct platform_device *devices[] __initdata = { ...@@ -89,6 +92,48 @@ static struct platform_device *devices[] __initdata = {
&locomo_device, &locomo_device,
}; };
static struct mtd_partition collie_partitions[] = {
{
.name = "bootloader",
.offset = 0,
.size = 0x000C0000,
.mask_flags = MTD_WRITEABLE
}, {
.name = "kernel",
.offset = MTDPART_OFS_APPEND,
.size = 0x00100000,
}, {
.name = "rootfs",
.offset = MTDPART_OFS_APPEND,
.size = 0x00e20000,
}
};
static void collie_set_vpp(int vpp)
{
COLLIE_SCP_REG_GPCR |= COLLIE_SCP_VPEN;
if (vpp) {
COLLIE_SCP_REG_GPWR |= COLLIE_SCP_VPEN;
} else {
COLLIE_SCP_REG_GPWR &= ~COLLIE_SCP_VPEN;
}
}
static struct flash_platform_data collie_flash_data = {
.map_name = "cfi_probe",
.set_vpp = collie_set_vpp,
.parts = collie_partitions,
.nr_parts = ARRAY_SIZE(collie_partitions),
};
static struct resource collie_flash_resources[] = {
{
.start = SA1100_CS0_PHYS,
.end = SA1100_CS0_PHYS + SZ_32M - 1,
.flags = IORESOURCE_MEM,
}
};
static void __init collie_init(void) static void __init collie_init(void)
{ {
int ret = 0; int ret = 0;
...@@ -121,6 +166,9 @@ static void __init collie_init(void) ...@@ -121,6 +166,9 @@ static void __init collie_init(void)
if (ret) { if (ret) {
printk(KERN_WARNING "collie: Unable to register LoCoMo device\n"); printk(KERN_WARNING "collie: Unable to register LoCoMo device\n");
} }
sa11x0_set_flash_data(&collie_flash_data, collie_flash_resources,
ARRAY_SIZE(collie_flash_resources));
} }
static struct map_desc collie_io_desc[] __initdata = { static struct map_desc collie_io_desc[] __initdata = {
...@@ -140,6 +188,6 @@ MACHINE_START(COLLIE, "Sharp-Collie") ...@@ -140,6 +188,6 @@ MACHINE_START(COLLIE, "Sharp-Collie")
BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
MAPIO(collie_map_io) MAPIO(collie_map_io)
INITIRQ(sa1100_init_irq) INITIRQ(sa1100_init_irq)
INIT_MACHINE(collie_init)
.timer = &sa1100_timer, .timer = &sa1100_timer,
.init_machine = collie_init,
MACHINE_END MACHINE_END
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/serial_core.h> #include <linux/serial_core.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -34,6 +37,7 @@ ...@@ -34,6 +37,7 @@
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/flash.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/mach/serial_sa1100.h> #include <asm/mach/serial_sa1100.h>
...@@ -52,6 +56,74 @@ ...@@ -52,6 +56,74 @@
struct ipaq_model_ops ipaq_model_ops; struct ipaq_model_ops ipaq_model_ops;
EXPORT_SYMBOL(ipaq_model_ops); EXPORT_SYMBOL(ipaq_model_ops);
static struct mtd_partition h3xxx_partitions[] = {
{
.name = "H3XXX boot firmware",
.size = 0x00040000,
.offset = 0,
.mask_flags = MTD_WRITEABLE, /* force read-only */
}, {
#ifdef CONFIG_MTD_2PARTS_IPAQ
.name = "H3XXX root jffs2",
.size = MTDPART_SIZ_FULL,
.offset = 0x00040000,
#else
.name = "H3XXX kernel",
.size = 0x00080000,
.offset = 0x00040000,
}, {
.name = "H3XXX params",
.size = 0x00040000,
.offset = 0x000C0000,
}, {
#ifdef CONFIG_JFFS2_FS
.name = "H3XXX root jffs2",
.size = MTDPART_SIZ_FULL,
.offset = 0x00100000,
#else
.name = "H3XXX initrd",
.size = 0x00100000,
.offset = 0x00100000,
}, {
.name = "H3XXX root cramfs",
.size = 0x00300000,
.offset = 0x00200000,
}, {
.name = "H3XXX usr cramfs",
.size = 0x00800000,
.offset = 0x00500000,
}, {
.name = "H3XXX usr local",
.size = MTDPART_SIZ_FULL,
.offset = 0x00d00000,
#endif
#endif
}
};
static void h3xxx_set_vpp(int vpp)
{
assign_h3600_egpio(IPAQ_EGPIO_VPP_ON, vpp);
}
static struct flash_platform_data h3xxx_flash_data = {
.map_name = "cfi_probe",
.set_vpp = h3xxx_set_vpp,
.parts = h3xxx_partitions,
.nr_parts = ARRAY_SIZE(h3xxx_partitions),
};
static struct resource h3xxx_flash_resource = {
.start = SA1100_CS0_PHYS,
.end = SA1100_CS0_PHYS + SZ_32M - 1,
.flags = IORESOURCE_MEM,
};
static void h3xxx_mach_init(void)
{
sa11x0_set_flash_data(&h3xxx_flash_data, &h3xxx_flash_resource, 1);
}
/* /*
* low-level UART features * low-level UART features
*/ */
...@@ -287,6 +359,7 @@ MACHINE_START(H3100, "Compaq iPAQ H3100") ...@@ -287,6 +359,7 @@ MACHINE_START(H3100, "Compaq iPAQ H3100")
MAPIO(h3100_map_io) MAPIO(h3100_map_io)
INITIRQ(sa1100_init_irq) INITIRQ(sa1100_init_irq)
.timer = &sa1100_timer, .timer = &sa1100_timer,
.init_machine = h3xxx_mach_init,
MACHINE_END MACHINE_END
#endif /* CONFIG_SA1100_H3100 */ #endif /* CONFIG_SA1100_H3100 */
...@@ -402,6 +475,7 @@ MACHINE_START(H3600, "Compaq iPAQ H3600") ...@@ -402,6 +475,7 @@ MACHINE_START(H3600, "Compaq iPAQ H3600")
MAPIO(h3600_map_io) MAPIO(h3600_map_io)
INITIRQ(sa1100_init_irq) INITIRQ(sa1100_init_irq)
.timer = &sa1100_timer, .timer = &sa1100_timer,
.init_machine = h3xxx_mach_init,
MACHINE_END MACHINE_END
#endif /* CONFIG_SA1100_H3600 */ #endif /* CONFIG_SA1100_H3600 */
...@@ -786,6 +860,7 @@ MACHINE_START(H3800, "Compaq iPAQ H3800") ...@@ -786,6 +860,7 @@ MACHINE_START(H3800, "Compaq iPAQ H3800")
MAPIO(h3800_map_io) MAPIO(h3800_map_io)
INITIRQ(h3800_init_irq) INITIRQ(h3800_init_irq)
.timer = &sa1100_timer, .timer = &sa1100_timer,
.init_machine = h3xxx_mach_init,
MACHINE_END MACHINE_END
#endif /* CONFIG_SA1100_H3800 */ #endif /* CONFIG_SA1100_H3800 */
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/cpufreq.h> #include <linux/cpufreq.h>
#include <linux/serial_core.h> #include <linux/serial_core.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
...@@ -28,6 +30,7 @@ ...@@ -28,6 +30,7 @@
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/flash.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
#include <asm/mach/serial_sa1100.h> #include <asm/mach/serial_sa1100.h>
...@@ -39,8 +42,6 @@ ...@@ -39,8 +42,6 @@
*/ */
/* init funcs */ /* init funcs */
static int __init hackkit_init(void);
static void __init hackkit_init_irq(void);
static void __init hackkit_map_io(void); static void __init hackkit_map_io(void);
static u_int hackkit_get_mctrl(struct uart_port *port); static u_int hackkit_get_mctrl(struct uart_port *port);
...@@ -83,11 +84,6 @@ static void __init hackkit_map_io(void) ...@@ -83,11 +84,6 @@ static void __init hackkit_map_io(void)
Ser1SDCR0 |= SDCR0_SUS; Ser1SDCR0 |= SDCR0_SUS;
} }
static void __init hackkit_init_irq(void)
{
/* none used yet */
}
/** /**
* hackkit_uart_pm - powermgmt callback function for system 3 UART * hackkit_uart_pm - powermgmt callback function for system 3 UART
* @port: uart port structure * @port: uart port structure
...@@ -144,35 +140,61 @@ static u_int hackkit_get_mctrl(struct uart_port *port) ...@@ -144,35 +140,61 @@ static u_int hackkit_get_mctrl(struct uart_port *port)
return ret; return ret;
} }
static int __init hackkit_init(void) static struct mtd_partition hackkit_partitions[] = {
{ {
int ret = 0; .name = "BLOB",
.size = 0x00040000,
if ( !machine_is_hackkit() ) { .offset = 0x00000000,
ret = -EINVAL; .mask_flags = MTD_WRITEABLE, /* force read-only */
goto DONE; }, {
.name = "config",
.size = 0x00040000,
.offset = MTDPART_OFS_APPEND,
}, {
.name = "kernel",
.size = 0x00100000,
.offset = MTDPART_OFS_APPEND,
}, {
.name = "initrd",
.size = 0x00180000,
.offset = MTDPART_OFS_APPEND,
}, {
.name = "rootfs",
.size = 0x700000,
.offset = MTDPART_OFS_APPEND,
}, {
.name = "data",
.size = MTDPART_SIZ_FULL,
.offset = MTDPART_OFS_APPEND,
} }
};
static struct flash_platform_data hackkit_flash_data = {
.map_name = "cfi_probe",
.parts = hackkit_partitions,
.nr_parts = ARRAY_SIZE(hackkit_partitions),
};
hackkit_init_irq(); static struct resource hackkit_flash_resource = {
.start = SA1100_CS0_PHYS,
.end = SA1100_CS0_PHYS + SZ_32M,
.flags = IORESOURCE_MEM,
};
ret = 0; static void __init hackkit_init(void)
DONE: {
return ret; sa11x0_set_flash_data(&hackkit_flash_data, &hackkit_flash_resource, 1);
} }
/********************************************************************** /**********************************************************************
* Exported Functions * Exported Functions
*/ */
/**********************************************************************
* kernel magic macros
*/
arch_initcall(hackkit_init);
MACHINE_START(HACKKIT, "HackKit Cpu Board") MACHINE_START(HACKKIT, "HackKit Cpu Board")
BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
BOOT_PARAMS(0xc0000100) BOOT_PARAMS(0xc0000100)
MAPIO(hackkit_map_io) MAPIO(hackkit_map_io)
INITIRQ(sa1100_init_irq) INITIRQ(sa1100_init_irq)
.timer = &sa1100_timer, .timer = &sa1100_timer,
.init_machine = hackkit_init,
MACHINE_END MACHINE_END
...@@ -5,18 +5,55 @@ ...@@ -5,18 +5,55 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/flash.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/mach/serial_sa1100.h> #include <asm/mach/serial_sa1100.h>
#include <asm/arch/shannon.h> #include <asm/arch/shannon.h>
#include "generic.h" #include "generic.h"
static struct mtd_partition shannon_partitions[] = {
{
.name = "BLOB boot loader",
.offset = 0,
.size = 0x20000
},
{
.name = "kernel",
.offset = MTDPART_OFS_APPEND,
.size = 0xe0000
},
{
.name = "initrd",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL
}
};
static struct flash_platform_data shannon_flash_data = {
.map_name = "cfi_probe",
.parts = shannon_partitions,
.nr_parts = ARRAY_SIZE(shannon_partitions),
};
static struct resource shannon_flash_resource = {
.start = SA1100_CS0_PHYS,
.end = SA1100_CS0_PHYS + SZ_4M - 1,
.flags = IORESOURCE_MEM,
};
static void __init shannon_init(void)
{
sa11x0_set_flash_data(&shannon_flash_data, shannon_flash_resource, 1);
}
static void __init shannon_map_io(void) static void __init shannon_map_io(void)
{ {
...@@ -42,4 +79,5 @@ MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)") ...@@ -42,4 +79,5 @@ MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)")
MAPIO(shannon_map_io) MAPIO(shannon_map_io)
INITIRQ(sa1100_init_irq) INITIRQ(sa1100_init_irq)
.timer = &sa1100_timer, .timer = &sa1100_timer,
.init_machine = shannon_init,
MACHINE_END MACHINE_END
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