23 #ifdef CONFIG_MTD_PHYSMAP
27 #include <mach/hardware.h>
31 #define IOP13XX_UART_XTAL 33334000
32 #define IOP13XX_SETUP_DEBUG 0
33 #define PRINTK(x...) ((void)(IOP13XX_SETUP_DEBUG && printk(x)))
46 static struct resource iop13xx_uart0_resources[] = {
59 static struct resource iop13xx_uart1_resources[] = {
100 .name =
"serial8250",
102 .dev.platform_data = iop13xx_uart0_data,
104 .resource = iop13xx_uart0_resources,
108 .name =
"serial8250",
110 .dev.platform_data = iop13xx_uart1_data,
112 .resource = iop13xx_uart1_resources
115 static struct resource iop13xx_i2c_0_resources[] = {
128 static struct resource iop13xx_i2c_1_resources[] = {
141 static struct resource iop13xx_i2c_2_resources[] = {
160 .name =
"IOP3xx-I2C",
163 .resource = iop13xx_i2c_0_resources
167 .name =
"IOP3xx-I2C",
170 .resource = iop13xx_i2c_1_resources
174 .name =
"IOP3xx-I2C",
177 .resource = iop13xx_i2c_2_resources
180 #ifdef CONFIG_MTD_PHYSMAP
187 static struct resource iq8134x_flash_resource = {
194 .
name =
"physmap-flash",
196 .dev = { .platform_data = &iq8134x_flash_data, },
198 .resource = &iq8134x_flash_resource,
201 static unsigned long iq8134x_probe_flash_size(
void)
206 unsigned long size = 0;
215 query[i / width] =
readb(flash_addr + (0x10 * width) + i);
218 if (
memcmp(query,
"QRY", 3) == 0)
219 size = 1 <<
readb(flash_addr + (0x27 * width));
232 static struct resource iop13xx_adma_0_resources[] = {
255 static struct resource iop13xx_adma_1_resources[] = {
278 static struct resource iop13xx_adma_2_resources[] = {
322 .resource = iop13xx_adma_0_resources,
324 .dma_mask = &iop13xx_adma_dmamask,
326 .platform_data = (
void *) &iop13xx_adma_0_data,
334 .resource = iop13xx_adma_1_resources,
336 .dma_mask = &iop13xx_adma_dmamask,
338 .platform_data = (
void *) &iop13xx_adma_1_data,
346 .resource = iop13xx_adma_2_resources,
348 .dma_mask = &iop13xx_adma_dmamask,
350 .platform_data = (
void *) &iop13xx_adma_2_data,
360 static int init_uart;
362 static int init_adma;
367 u32 uart_idx, i2c_idx, adma_idx, plat_idx;
373 memset(iop13xx_devices, 0,
sizeof(iop13xx_devices));
425 PRINTK(
"Adding uart1 to platform device list\n");
426 iop13xx_uart1.
id = uart_idx++;
427 iop13xx_devices[plat_idx++] = &iop13xx_uart1;
430 PRINTK(
"Adding uart0 to platform device list\n");
431 iop13xx_uart0.
id = uart_idx++;
432 iop13xx_devices[plat_idx++] = &iop13xx_uart0;
437 printk(
"Adding i2c%d to platform device list\n", i);
438 switch(init_i2c & (1 << i)) {
440 iop13xx_i2c_0_controller.
id = i2c_idx++;
441 iop13xx_devices[plat_idx++] =
442 &iop13xx_i2c_0_controller;
445 iop13xx_i2c_1_controller.
id = i2c_idx++;
446 iop13xx_devices[plat_idx++] =
447 &iop13xx_i2c_1_controller;
450 iop13xx_i2c_2_controller.
id = i2c_idx++;
451 iop13xx_devices[plat_idx++] =
452 &iop13xx_i2c_2_controller;
463 "Adding adma%d to platform device list\n", i);
464 switch (init_adma & (1 << i)) {
466 iop13xx_adma_0_channel.
id = adma_idx++;
467 iop13xx_devices[plat_idx++] = &iop13xx_adma_0_channel;
468 plat_data = &iop13xx_adma_0_data;
476 iop13xx_adma_1_channel.
id = adma_idx++;
477 iop13xx_devices[plat_idx++] = &iop13xx_adma_1_channel;
478 plat_data = &iop13xx_adma_1_data;
486 iop13xx_adma_2_channel.
id = adma_idx++;
487 iop13xx_devices[plat_idx++] = &iop13xx_adma_2_channel;
488 plat_data = &iop13xx_adma_2_data;
500 #ifdef CONFIG_MTD_PHYSMAP
501 iq8134x_flash_resource.
end = iq8134x_flash_resource.
start +
502 iq8134x_probe_flash_size() - 1;
503 if (iq8134x_flash_resource.
end > iq8134x_flash_resource.
start)
504 iop13xx_devices[plat_idx++] = &iq8134x_flash;
512 static int __init iop13xx_init_uart_setup(
char *
str)
515 while (*str !=
'\0') {
527 PRINTK(
"\"iop13xx_init_uart\" malformed"
528 " at character: \'%c\'", *str);
538 static int __init iop13xx_init_i2c_setup(
char *str)
541 while (*str !=
'\0') {
556 PRINTK(
"\"iop13xx_init_i2c\" malformed"
557 " at character: \'%c\'", *str);
567 static int __init iop13xx_init_adma_setup(
char *str)
570 while (*str !=
'\0') {
585 PRINTK(
"\"iop13xx_init_adma\" malformed"
586 " at character: \'%c\'", *str);
596 __setup(
"iop13xx_init_adma", iop13xx_init_adma_setup);
597 __setup(
"iop13xx_init_uart", iop13xx_init_uart_setup);
598 __setup(
"iop13xx_init_i2c", iop13xx_init_i2c_setup);