13 #include <linux/kernel.h>
14 #include <linux/module.h>
15 #include <linux/errno.h>
17 #include <linux/serial_core.h>
24 #include <linux/slab.h>
26 #include <video/sa1100fb.h>
28 #include <mach/hardware.h>
30 #include <asm/setup.h>
32 #include <asm/pgtable-hwdef.h>
33 #include <asm/pgtable.h>
34 #include <asm/tlbflush.h>
43 #include <mach/irqs.h>
47 #define ASSABET_BCR_DB1110 \
48 (ASSABET_BCR_SPK_OFF | \
49 ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED | \
50 ASSABET_BCR_RS232EN | ASSABET_BCR_LCD_12RGB | \
53 #define ASSABET_BCR_DB1111 \
54 (ASSABET_BCR_SPK_OFF | \
55 ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED | \
56 ASSABET_BCR_RS232EN | ASSABET_BCR_LCD_12RGB | \
57 ASSABET_BCR_CF_BUS_OFF | ASSABET_BCR_STEREO_LB | \
58 ASSABET_BCR_IRDA_MD0 | ASSABET_BCR_CF_RST)
70 BCR_value = (BCR_value & ~mask) | val;
99 .name =
"bootloader params",
115 .
name =
"bootloader",
120 .name =
"bootloader params",
133 .map_name =
"cfi_probe",
134 .parts = assabet_partitions,
138 static struct resource assabet_flash_resources[] = {
148 static int assabet_irda_set_power(
struct device *
dev,
unsigned int state)
150 static unsigned int bcr_state[4] = {
158 state = bcr_state[
state];
166 static void assabet_irda_set_speed(
struct device *dev,
unsigned int speed)
175 .set_power = assabet_irda_set_power,
176 .set_speed = assabet_irda_set_speed,
180 .reset = assabet_ucb1x00_reset,
186 .sclk_rate = 11981000,
187 .codec_pdata = &assabet_ucb1x00_data,
190 static void assabet_lcd_set_visual(
u32 visual)
194 if (machine_is_assabet()) {
195 #if 1 // phase 4 or newer Assabet's
210 #ifndef ASSABET_PAL_VIDEO
211 static void assabet_lcd_backlight_power(
int on)
224 static void assabet_lcd_power(
int on)
239 .pixclock = 171521, .bpp = 16,
240 .xres = 320, .yres = 240,
242 .hsync_len = 5, .vsync_len = 1,
243 .left_margin = 61, .upper_margin = 3,
244 .right_margin = 9, .lower_margin = 0,
251 .backlight_power = assabet_lcd_backlight_power,
252 .lcd_power = assabet_lcd_power,
253 .set_visual = assabet_lcd_set_visual,
256 static void assabet_pal_backlight_power(
int on)
261 static void assabet_pal_power(
int on)
268 .xres = 640, .yres = 512,
270 .hsync_len = 64, .vsync_len = 6,
271 .left_margin = 125, .upper_margin = 70,
272 .right_margin = 115, .lower_margin = 36,
277 .backlight_power = assabet_pal_backlight_power,
278 .lcd_power = assabet_pal_power,
279 .set_visual = assabet_lcd_set_visual,
283 #ifdef CONFIG_ASSABET_NEPONSET
284 static struct resource neponset_resources[] = {
292 static void __init assabet_init(
void)
338 #ifndef CONFIG_ASSABET_NEPONSET
339 printk(
"Warning: Neponset detected but full support "
340 "hasn't been configured in the kernel\n" );
342 platform_device_register_simple(
"neponset", 0,
343 neponset_resources,
ARRAY_SIZE(neponset_resources));
347 #ifndef ASSABET_PAL_VIDEO
364 static void __init map_sa1100_gpio_regs(
void )
367 unsigned long virt = (
unsigned long)
io_p2v(phys);
372 *pmd =
__pmd(phys | prot);
373 flush_pmd_entry(pmd);
389 static void __init get_assabet_scr(
void)
407 map_sa1100_gpio_regs();
411 printk(
"Neponset expansion board detected\n");
433 static void assabet_set_mctrl(
struct uart_port *port,
u_int mctrl)
485 .set_mctrl = assabet_set_mctrl,
486 .get_mctrl = assabet_get_mctrl,
487 .pm = assabet_uart_pm,
490 static struct map_desc assabet_io_desc[] __initdata = {
492 .virtual = 0xf1000000,
494 .length = 0x00100000,
497 .virtual = 0xf2800000,
499 .length = 0x00800000,
504 static void __init assabet_map_io(
void)
535 #if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
545 static const struct {
549 {
"assabet:red",
"cpu0",},
550 {
"assabet:green",
"heartbeat", },
562 struct assabet_led, cdev);
573 struct assabet_led, cdev);
578 static int __init assabet_leds_init(
void)
582 if (!machine_is_assabet())
585 for (i = 0; i <
ARRAY_SIZE(assabet_leds); i++) {
586 struct assabet_led *
led;
592 led->cdev.name = assabet_leds[
i].name;
593 led->cdev.brightness_set = assabet_led_set;
594 led->cdev.brightness_get = assabet_led_get;
595 led->cdev.default_trigger = assabet_leds[
i].trigger;
619 .atag_offset = 0x100,
620 .fixup = fixup_assabet,
621 .map_io = assabet_map_io,
625 .init_machine = assabet_init,
628 .dma_zone_size =
SZ_1M,