/* * The codec reset goes to three devices, so we need to release * the rest when any one of these requests it. However, that * causes the ADV7171 to consume around 100mA - more than half * the LCD-blanked power. * * With the ADV7171, LCD and backlight enabled, we go over * budget on the MAX846 Li-Ion charger, and if no Li-Ion battery * is connected, the Assabet crashes.
*/ #define RST_UCB1X00 (1 << 0) #define RST_UDA1341 (1 << 1) #define RST_ADV7171 (1 << 2)
#define SDA GPIO_GPIO(15) #define SCK GPIO_GPIO(18) #define MOD GPIO_GPIO(17)
/* Restore GPIO state for L3 bus */
GPSR = gplr & (SDA | SCK | MOD);
GPCR = (~gplr) & (SDA | SCK | MOD);
GPDR = gpdr;
}
staticvoid adv7171_sleep(void)
{ /* Put the ADV7171 into sleep mode */
adv7171_write(0x04, 0x40);
}
staticunsigned codec_nreset;
staticvoid assabet_codec_reset(unsigned mask, int set)
{ unsignedlong flags; bool old;
local_irq_save(flags);
old = !codec_nreset; if (set)
codec_nreset &= ~mask; else
codec_nreset |= mask;
if (old != !codec_nreset) { if (codec_nreset) {
ASSABET_BCR_set(ASSABET_BCR_NCODEC_RST);
adv7171_sleep();
} else {
ASSABET_BCR_clear(ASSABET_BCR_NCODEC_RST);
}
}
local_irq_restore(flags);
}
staticvoid assabet_ucb1x00_reset(enum ucb1x00_reset state)
{ int set = state == UCB_RST_REMOVE || state == UCB_RST_SUSPEND ||
state == UCB_RST_PROBE_FAIL;
assabet_codec_reset(RST_UCB1X00, set);
}
/* * Turn on/off the backlight. When turning the backlight on, we wait * 500us after turning it on so we don't cause the supplies to droop * when we enable the LCD controller (and cause a hard reset.)
*/ staticvoid assabet_lcd_power(int on)
{ if (on) {
ASSABET_BCR_set(ASSABET_BCR_LCD_ON);
udelay(500);
} else
ASSABET_BCR_clear(ASSABET_BCR_LCD_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).
*/ staticstruct sa1100fb_mach_info lq039q2ds54_info = {
.pixclock = 171521, .bpp = 16,
.xres = 320, .yres = 240,
staticvoid __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;
if (machine_has_neponset()) { #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
} else {
gpiod_add_lookup_table(&assabet_uart1_gpio_table);
gpiod_add_lookup_table(&assabet_uart3_gpio_table);
gpiod_add_lookup_table(&assabet_cf_vcc_gpio_table);
if (!machine_has_neponset())
sa11x0_register_pcmcia(1, &assabet_cf_gpio_table);
}
/* * 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.
*/ staticvoid __init map_sa1100_gpio_regs( void )
{ unsignedlong phys = __PREG(GPLR) & PMD_MASK; unsignedlong virt = (unsignedlong)io_p2v(phys); int prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_DOMAIN(DOMAIN_IO);
pmd_t *pmd;
/* * Read System Configuration "Register" * (taken from "Intel StrongARM SA-1110 Microprocessor Development Board * User's Guide", section 4.4.1) * * This same scan is performed in arch/arm/boot/compressed/head-sa1100.S * to set up the serial port for decompression status messages. We * repeat it here because the kernel may not be loaded as a zImage, and * also because it's a hassle to communicate the SCR value to the kernel * from the decompressor. * * Note that IRQs are guaranteed to be disabled.
*/ staticvoid __init get_assabet_scr(void)
{ unsignedlong scr, i;
GPDR |= 0x3fc; /* Configure GPIO 9:2 as outputs */
GPSR = 0x3fc; /* Write 0xFF to GPIO 9:2 */
GPDR &= ~(0x3fc); /* Configure GPIO 9:2 as inputs */ for(i = 100; i--; ) /* Read GPIO 9:2 */
scr = GPLR;
GPDR |= 0x3fc; /* restore correct pin direction */
scr &= 0x3fc; /* save as system configuration byte. */
SCR_value = scr;
}
staticvoid __init
fixup_assabet(struct tag *tags, char **cmdline)
{ /* This must be done before any call to machine_has_neponset() */
map_sa1100_gpio_regs();
get_assabet_scr();
if (machine_has_neponset())
printk("Neponset expansion board detected\n");
}
/* * Set SUS bit in SDCR0 so serial port 1 functions. * Its called GPCLKR0 in my SA1110 manual.
*/
Ser1SDCR0 |= SDCR0_SUS;
MSC1 = (MSC1 & ~0xffff) |
MSC_NonBrst | MSC_32BitStMem |
MSC_RdAcc(2) | MSC_WrAcc(2) | MSC_Rec(0);
if (!machine_has_neponset())
sa1100_register_uart_fns(&assabet_port_fns);
/* * When Neponset is attached, the first UART should be * UART3. That's what Angel is doing and many documents * are stating this. * * We do the Neponset mapping even if Neponset support * isn't compiled in so the user will still get something on * the expected physical serial port. * * We no longer do this; not all boot loaders support it, * and UART3 appears to be somewhat unreliable with blob.
*/
sa1100_register_uart(0, 1);
sa1100_register_uart(2, 3);
}
if (machine_has_neponset())
def_val = ASSABET_BCR_DB1111; else
def_val = ASSABET_BCR_DB1110;
/* * Angel sets this, but other bootloaders may not. * * This must precede any driver calls to BCR_set() or BCR_clear().
*/
assabet_init_gpio((void *)&ASSABET_BCR, def_val);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.