|
@@ -232,3 +232,143 @@ static void assabet_lcd_power(int on)
|
|
|
|
|
|
/*
|
|
|
* The assabet uses a sharp LQ039Q2DS54 LCD module. It is actually
|
|
|
+ * takes an RGB666 signal, but we provide it with an RGB565 signal
|
|
|
+ * instead (def_rgb_16).
|
|
|
+ */
|
|
|
+static struct sa1100fb_mach_info lq039q2ds54_info = {
|
|
|
+ .pixclock = 171521, .bpp = 16,
|
|
|
+ .xres = 320, .yres = 240,
|
|
|
+
|
|
|
+ .hsync_len = 5, .vsync_len = 1,
|
|
|
+ .left_margin = 61, .upper_margin = 3,
|
|
|
+ .right_margin = 9, .lower_margin = 0,
|
|
|
+
|
|
|
+ .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
|
|
|
+
|
|
|
+ .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
|
|
|
+ .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
|
|
|
+
|
|
|
+ .backlight_power = assabet_lcd_backlight_power,
|
|
|
+ .lcd_power = assabet_lcd_power,
|
|
|
+ .set_visual = assabet_lcd_set_visual,
|
|
|
+};
|
|
|
+#else
|
|
|
+static void assabet_pal_backlight_power(int on)
|
|
|
+{
|
|
|
+ ASSABET_BCR_clear(ASSABET_BCR_LIGHT_ON);
|
|
|
+}
|
|
|
+
|
|
|
+static void assabet_pal_power(int on)
|
|
|
+{
|
|
|
+ ASSABET_BCR_clear(ASSABET_BCR_LCD_ON);
|
|
|
+}
|
|
|
+
|
|
|
+static struct sa1100fb_mach_info pal_info = {
|
|
|
+ .pixclock = 67797, .bpp = 16,
|
|
|
+ .xres = 640, .yres = 512,
|
|
|
+
|
|
|
+ .hsync_len = 64, .vsync_len = 6,
|
|
|
+ .left_margin = 125, .upper_margin = 70,
|
|
|
+ .right_margin = 115, .lower_margin = 36,
|
|
|
+
|
|
|
+ .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
|
|
|
+ .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(512),
|
|
|
+
|
|
|
+ .backlight_power = assabet_pal_backlight_power,
|
|
|
+ .lcd_power = assabet_pal_power,
|
|
|
+ .set_visual = assabet_lcd_set_visual,
|
|
|
+};
|
|
|
+#endif
|
|
|
+
|
|
|
+#ifdef CONFIG_ASSABET_NEPONSET
|
|
|
+static struct resource neponset_resources[] = {
|
|
|
+ DEFINE_RES_MEM(0x10000000, 0x08000000),
|
|
|
+ DEFINE_RES_MEM(0x18000000, 0x04000000),
|
|
|
+ DEFINE_RES_MEM(0x40000000, SZ_8K),
|
|
|
+ DEFINE_RES_IRQ(IRQ_GPIO25),
|
|
|
+};
|
|
|
+#endif
|
|
|
+
|
|
|
+static void __init assabet_init(void)
|
|
|
+{
|
|
|
+ /*
|
|
|
+ * Ensure that the power supply is in "high power" mode.
|
|
|
+ */
|
|
|
+ GPSR = GPIO_GPIO16;
|
|
|
+ GPDR |= GPIO_GPIO16;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * Ensure that these pins are set as outputs and are driving
|
|
|
+ * logic 0. This ensures that we won't inadvertently toggle
|
|
|
+ * the WS latch in the CPLD, and we don't float causing
|
|
|
+ * excessive power drain. --rmk
|
|
|
+ */
|
|
|
+ GPCR = GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM;
|
|
|
+ GPDR |= GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * Also set GPIO27 as an output; this is used to clock UART3
|
|
|
+ * via the FPGA and as otherwise has no pullups or pulldowns,
|
|
|
+ * so stop it floating.
|
|
|
+ */
|
|
|
+ GPCR = GPIO_GPIO27;
|
|
|
+ GPDR |= GPIO_GPIO27;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * Set up registers for sleep mode.
|
|
|
+ */
|
|
|
+ PWER = PWER_GPIO0;
|
|
|
+ PGSR = 0;
|
|
|
+ PCFR = 0;
|
|
|
+ PSDR = 0;
|
|
|
+ PPDR |= PPC_TXD3 | PPC_TXD1;
|
|
|
+ PPSR |= PPC_TXD3 | PPC_TXD1;
|
|
|
+
|
|
|
+ sa11x0_ppc_configure_mcp();
|
|
|
+
|
|
|
+ if (machine_has_neponset()) {
|
|
|
+ /*
|
|
|
+ * Angel sets this, but other bootloaders may not.
|
|
|
+ *
|
|
|
+ * This must precede any driver calls to BCR_set()
|
|
|
+ * or BCR_clear().
|
|
|
+ */
|
|
|
+ ASSABET_BCR = BCR_value = ASSABET_BCR_DB1111;
|
|
|
+
|
|
|
+#ifndef CONFIG_ASSABET_NEPONSET
|
|
|
+ printk( "Warning: Neponset detected but full support "
|
|
|
+ "hasn't been configured in the kernel\n" );
|
|
|
+#else
|
|
|
+ platform_device_register_simple("neponset", 0,
|
|
|
+ neponset_resources, ARRAY_SIZE(neponset_resources));
|
|
|
+#endif
|
|
|
+ }
|
|
|
+
|
|
|
+#ifndef ASSABET_PAL_VIDEO
|
|
|
+ sa11x0_register_lcd(&lq039q2ds54_info);
|
|
|
+#else
|
|
|
+ sa11x0_register_lcd(&pal_video);
|
|
|
+#endif
|
|
|
+ sa11x0_register_mtd(&assabet_flash_data, assabet_flash_resources,
|
|
|
+ ARRAY_SIZE(assabet_flash_resources));
|
|
|
+ sa11x0_register_irda(&assabet_irda_data);
|
|
|
+ sa11x0_register_mcp(&assabet_mcp_data);
|
|
|
+}
|
|
|
+
|
|
|
+/*
|
|
|
+ * On Assabet, we must probe for the Neponset board _before_
|
|
|
+ * paging_init() has occurred to actually determine the amount
|
|
|
+ * of RAM available. To do so, we map the appropriate IO section
|
|
|
+ * in the page table here in order to access GPIO registers.
|
|
|
+ */
|
|
|
+static void __init map_sa1100_gpio_regs( void )
|
|
|
+{
|
|
|
+ unsigned long phys = __PREG(GPLR) & PMD_MASK;
|
|
|
+ unsigned long virt = (unsigned long)io_p2v(phys);
|
|
|
+ int prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_DOMAIN(DOMAIN_IO);
|
|
|
+ pmd_t *pmd;
|
|
|
+
|
|
|
+ pmd = pmd_offset(pud_offset(pgd_offset_k(virt), virt), virt);
|
|
|
+ *pmd = __pmd(phys | prot);
|
|
|
+ flush_pmd_entry(pmd);
|
|
|
+}
|