2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License version 2 as published
4 * by the Free Software Foundation.
6 * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
9 #include <linux/init.h>
10 #include <linux/export.h>
11 #include <linux/types.h>
12 #include <linux/string.h>
13 #include <linux/kernel.h>
14 #include <linux/reboot.h>
15 #include <linux/platform_device.h>
16 #include <linux/leds.h>
17 #include <linux/etherdevice.h>
18 #include <linux/time.h>
20 #include <linux/gpio.h>
22 #include <asm/bootinfo.h>
25 #include <lantiq_soc.h>
30 static struct resource ltq_nor_resource = {
32 .start = LTQ_FLASH_START,
33 .end = LTQ_FLASH_START + LTQ_FLASH_MAX - 1,
34 .flags = IORESOURCE_MEM,
37 static struct platform_device ltq_nor = {
39 .resource = <q_nor_resource,
43 void __init ltq_register_nor(struct physmap_flash_data *data)
45 ltq_nor.dev.platform_data = data;
46 platform_device_register(<q_nor);
50 static struct resource ltq_wdt_resource = {
52 .start = LTQ_WDT_BASE_ADDR,
53 .end = LTQ_WDT_BASE_ADDR + LTQ_WDT_SIZE - 1,
54 .flags = IORESOURCE_MEM,
57 void __init ltq_register_wdt(void)
59 platform_device_register_simple("ltq_wdt", 0, <q_wdt_resource, 1);
63 static struct resource ltq_asc0_resources[] = {
66 .start = LTQ_ASC0_BASE_ADDR,
67 .end = LTQ_ASC0_BASE_ADDR + LTQ_ASC_SIZE - 1,
68 .flags = IORESOURCE_MEM,
70 IRQ_RES(tx, LTQ_ASC_TIR(0)),
71 IRQ_RES(rx, LTQ_ASC_RIR(0)),
72 IRQ_RES(err, LTQ_ASC_EIR(0)),
75 static struct resource ltq_asc1_resources[] = {
78 .start = LTQ_ASC1_BASE_ADDR,
79 .end = LTQ_ASC1_BASE_ADDR + LTQ_ASC_SIZE - 1,
80 .flags = IORESOURCE_MEM,
82 IRQ_RES(tx, LTQ_ASC_TIR(1)),
83 IRQ_RES(rx, LTQ_ASC_RIR(1)),
84 IRQ_RES(err, LTQ_ASC_EIR(1)),
87 void __init ltq_register_asc(int port)
91 platform_device_register_simple("ltq_asc", 0,
92 ltq_asc0_resources, ARRAY_SIZE(ltq_asc0_resources));
95 platform_device_register_simple("ltq_asc", 1,
96 ltq_asc1_resources, ARRAY_SIZE(ltq_asc1_resources));
105 static struct platform_device ltq_pci = {
110 void __init ltq_register_pci(struct ltq_pci_data *data)
112 ltq_pci.dev.platform_data = data;
113 platform_device_register(<q_pci);
116 void __init ltq_register_pci(struct ltq_pci_data *data)
118 pr_err("kernel is compiled without PCI support\n");