22 #include <linux/kernel.h>
23 #include <linux/i2c.h>
32 #include <linux/videodev2.h>
33 #include <mach/common.h>
40 #include <mach/irqs.h>
93 #define BUSSWMR1 0x0070
94 #define BUSSWMR2 0x0072
95 #define BUSSWMR3 0x0074
96 #define BUSSWMR4 0x0076
99 #define DEVRSTCR1 0x10D0
100 #define DEVRSTCR2 0x10D2
101 #define A1MDSR 0x10E0
105 #define FPGA_IRQ_BASE (512)
106 #define FPGA_IRQ0 (FPGA_IRQ_BASE)
107 #define FPGA_IRQ1 (FPGA_IRQ_BASE + 16)
108 #define FPGA_ETH_IRQ (FPGA_IRQ0 + 15)
119 static void bonito_fpga_irq_disable(
struct irq_data *
data)
121 unsigned int irq = data->
irq;
123 int shift = irq % 16;
125 bonito_fpga_write(addr, bonito_fpga_read(addr) | (1 << shift));
128 static void bonito_fpga_irq_enable(
struct irq_data *data)
130 unsigned int irq = data->
irq;
132 int shift = irq % 16;
134 bonito_fpga_write(addr, bonito_fpga_read(addr) & ~(1 << shift));
138 .name =
"bonito FPGA",
139 .irq_mask = bonito_fpga_irq_disable,
140 .irq_unmask = bonito_fpga_irq_enable,
143 static void bonito_fpga_irq_demux(
unsigned int irq,
struct irq_desc *
desc)
145 u32 val = bonito_fpga_read(
IRQSR1) << 16 |
154 for (i = 0; i < 32; i++) {
155 if (!(val & (1 << i)))
162 static void bonito_fpga_init(
void)
166 bonito_fpga_write(
IRQMR0, 0xffff);
167 bonito_fpga_write(
IRQMR1, 0xffff);
180 irq_set_chained_handler(
evt2irq(0x0340), bonito_fpga_irq_demux);
193 static __u8 pmic_do_2A[] = {
199 static int __init pmic_init(
void)
216 for (i = 0; ; i += 2) {
217 buf[0] = pmic_settings[i + 0];
218 buf[1] = pmic_settings[i + 1];
220 if ((0xff == buf[0]) && (0xff == buf[1]))
225 pr_err(
"i2c transfer fail\n");
238 .name =
"WVGA Panel",
255 .interface_type =
RGB24,
258 .lcd_modes = &lcdc0_mode,
267 static struct resource lcdc0_resources[] = {
281 .name =
"sh_mobile_lcdc_fb",
283 .resource = lcdc0_resources,
286 .platform_data = &lcdc0_info,
287 .coherent_dma_mask = ~0,
294 static struct resource smsc_resources[] = {
297 .end = 0x18011000 - 1,
316 .platform_data = &smsc_platdata,
318 .resource = smsc_resources,
339 static struct map_desc bonito_io_desc[] __initdata = {
348 .type = MT_DEVICE_NONSHARED
352 static void __init bonito_map_io(
void)
361 #define BIT_ON(sw, bit) (sw & (1 << bit))
362 #define BIT_OFF(sw, bit) (!(sw & (1 << bit)))
364 #define VCCQ1CR IOMEM(0xE6058140)
365 #define VCCQ1LCDCR IOMEM(0xE6058186)
367 static void __init bonito_init(
void)
376 pmic_settings = pmic_do_2A;
382 #ifdef CONFIG_CACHE_L2X0
410 val = bonito_fpga_read(
BVERR);
411 pr_info(
"bonito version: cpu %02x, base %02x\n",
413 ((val >> 0) & 0xFF));
469 bonito_fpga_write(
LCDCR, 1);
481 static void __init bonito_earlytimer_init(
void)
487 val = bonito_fpga_read(
A1MDSR);
499 static void __init bonito_add_early_devices(
void)
508 .map_io = bonito_map_io,
509 .init_early = bonito_add_early_devices,
512 .init_machine = bonito_init,
513 .init_late = shmobile_init_late,