static void __init omap_4430sdp_init(void) { int status; int package = OMAP_PACKAGE_CBS; if (omap_rev() == OMAP4430_REV_ES1_0) package = OMAP_PACKAGE_CBL; omap4_mux_init(board_mux, NULL, package); omap4_i2c_init(); omap_sfh7741prox_init(); platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); board_serial_init(); omap4_sdp4430_wifi_init(); omap4_twl6030_hsmmc_init(mmc); usb_musb_init(&musb_board_data); status = omap_ethernet_init(); if (status) { pr_err("Ethernet initialization failed: %d\n", status); } else { sdp4430_spi_board_info[0].irq = gpio_to_irq(ETH_KS8851_IRQ); spi_register_board_info(sdp4430_spi_board_info, ARRAY_SIZE(sdp4430_spi_board_info)); } status = omap4_keyboard_init(&sdp4430_keypad_data, &keypad_data); if (status) pr_err("Keypad initialization failed: %d\n", status); omap_4430sdp_display_init(); }
static void __init omap4_panda_init(void) { int package = OMAP_PACKAGE_CBS; omap_emif_setup_device_details(&emif_devices, &emif_devices); if (omap_rev() == OMAP4430_REV_ES1_0) package = OMAP_PACKAGE_CBL; omap4_mux_init(board_mux, NULL, package); if (wl12xx_set_platform_data(&omap_panda_wlan_data)) pr_err("error setting wl12xx data\n"); omap4_panda_i2c_init(); omap4_audio_conf(); platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices)); /* * This is temporaray. With WLAN regsitering, we see that UART2 is not * idling on panda and CORE RET is not happening. So removing this FTM. * Later will be enabled. * * platform_device_register(&omap_vwlan_device); */ board_serial_init(); omap4_twl6030_hsmmc_init(mmc); omap4_ehci_init(); usb_musb_init(&musb_board_data); omap_dmm_init(); omap4_panda_display_init(); }
static void __init omap_tablet_init(void) { int package = OMAP_PACKAGE_CBS; int tablet_rev = 0; if (omap_rev() == OMAP4430_REV_ES1_0) package = OMAP_PACKAGE_CBL; omap4_mux_init(board_mux, NULL, package); acclaim_mem_init(); omap_board_config = tablet_config; omap_board_config_size = ARRAY_SIZE(tablet_config); tablet_rev = omap_init_board_version(0); omap4_create_board_props(); omap4_i2c_init(); #ifdef CONFIG_CHARGER_MAX8903 max8903_init_charger(); #endif //CONFIG_CHARGER_MAX8903 acclaim_touch_init(); omap_dmm_init(); acclaim_panel_init(); tablet_pmic_mux_init(); acclaim_button_init(); omap4_register_ion(); board_serial_init(); omap4_tablet_wifi_init(); omap4_twl6030_hsmmc_init(mmc); omap4_ehci_ohci_init(); usb_musb_init(&musb_board_data); omap_enable_smartreflex_on_init(); if (enable_suspend_off) omap_pm_enable_off_mode(); }
static void __init omap_tablet_init(void) { int status; int package = OMAP_PACKAGE_CBS; int tablet_rev = 0; if (omap_rev() == OMAP4430_REV_ES1_0) package = OMAP_PACKAGE_CBL; omap4_mux_init(board_mux, NULL, package); omap_emif_setup_device_details(&emif_devices, &emif_devices); omap_board_config = tablet_config; omap_board_config_size = ARRAY_SIZE(tablet_config); tablet_rev = omap_init_board_version(0); omap4_create_board_props(); omap4_audio_conf(); omap4_i2c_init(); tablet_touch_init(); tablet_camera_mux_init(); omap_dmm_init(); tablet_panel_init(); tablet_pmic_mux_init(); tablet_set_osc_timings(); tablet_button_init(); omap4_register_ion(); board_serial_init(); omap4_tablet_wifi_init(); omap4_twl6030_hsmmc_init(mmc); tablet_sensor_init(); platform_add_devices(tablet4430_devices, ARRAY_SIZE(tablet4430_devices)); wake_lock_init(&st_wk_lock, WAKE_LOCK_SUSPEND, "st_wake_lock"); omap4_ehci_ohci_init(); usb_musb_init(&musb_board_data); status = omap_ethernet_init(); if (status) { pr_err("Ethernet initialization failed: %d\n", status); } else { tablet_spi_board_info[0].irq = gpio_to_irq(ETH_KS8851_IRQ); spi_register_board_info(tablet_spi_board_info, ARRAY_SIZE(tablet_spi_board_info)); } if (cpu_is_omap446x()) { /* Vsel0 = gpio, vsel1 = gnd */ status = omap_tps6236x_board_setup(true, TPS62361_GPIO, -1, OMAP_PIN_OFF_OUTPUT_HIGH, -1); if (status) pr_err("TPS62361 initialization failed: %d\n", status); } omap_enable_smartreflex_on_init(); if (enable_suspend_off) omap_pm_enable_off_mode(); }
static void __init pcm049_init(void) { pm_power_off = pcm049_power_off; omap4_mux_init(board_mux, NULL, OMAP_PACKAGE_CBS); pcm049_init_smsc911x(); pcm049_i2c_init(); platform_add_devices(pcm049_devices, ARRAY_SIZE(pcm049_devices)); board_serial_init(); omap_sdrc_init(NULL, NULL); omap4_twl6030_hsmmc_init(mmc); omap4_ehci_init(); usb_musb_init(&musb_board_data); pcm049_display_init(); }
static void __init n8x0_init_machine(void) { omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); /* FIXME: add n810 spi devices */ spi_register_board_info(n800_spi_board_info, ARRAY_SIZE(n800_spi_board_info)); omap_register_i2c_bus(1, 400, n8x0_i2c_board_info_1, ARRAY_SIZE(n8x0_i2c_board_info_1)); omap_register_i2c_bus(2, 400, NULL, 0); if (machine_is_nokia_n810()) i2c_register_board_info(2, n810_i2c_board_info_2, ARRAY_SIZE(n810_i2c_board_info_2)); board_serial_init(); gpmc_onenand_init(board_onenand_data); n8x0_mmc_init(); n8x0_usb_init(); }
void __init omap_ovation_init(void) { int package = OMAP_PACKAGE_CBS; if (omap_rev() == OMAP4430_REV_ES1_0) package = OMAP_PACKAGE_CBL; omap4_mux_init(board_mux, NULL, package); /* Turn off the external FET for twl6032 charger */ gpio_request ( EXT_FET_EN , "EXT-FET-EN" ); gpio_direction_output ( EXT_FET_EN , 0 ); /* EVT1a bringup only */ if (system_rev == OVATION_EVT1A) { /* The GPIO for Charging level - 1=2A, 0=1A */ gpio_request(44, "ic_chg_level"); gpio_direction_output(44, 1); } ovation_mem_init(); omap_board_config = ovation_config; omap_board_config_size = ARRAY_SIZE(ovation_config); omap4_create_board_props(); omap4_audio_conf(); omap4_i2c_init(); ovation_lcd_touch_init(); ovation_touch_init(); omap_dmm_init(); ovation_panel_init(); ovation_pmic_mux_init(); ovation_button_init(); kxtj9_dev_init(); omap4_register_ion(); board_serial_init(); bn_wilink_init(); omap4_twl6030_hsmmc_init(mmc); usb_musb_init(&musb_board_data); omap_enable_smartreflex_on_init(); if (enable_suspend_off) omap_pm_enable_off_mode(); /* Enable GG bat_low irq to wake up device to inform framework to shutdown. */ omap_mux_init_gpio(BQ27500_BAT_LOW_GPIO, OMAP_PIN_INPUT | OMAP_PIN_OFF_WAKEUPENABLE); }
static void __init omap_4430sdp_init(void) { int status; int package = OMAP_PACKAGE_CBS; if (omap_rev() == OMAP4430_REV_ES1_0) package = OMAP_PACKAGE_CBL; omap4_mux_init(board_mux, NULL, package); omap_emif_setup_device_details(&emif_devices, &emif_devices); omap_board_config = sdp4430_config; omap_board_config_size = ARRAY_SIZE(sdp4430_config); omap4_i2c_init(); omap_sfh7741prox_init(); platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); board_serial_init(); omap4_twl6030_hsmmc_init(mmc); usb_musb_init(&musb_board_data); status = omap_ethernet_init(); if (status) { pr_err("Ethernet initialization failed: %d\n", status); } else { sdp4430_spi_board_info[0].irq = gpio_to_irq(ETH_KS8851_IRQ); spi_register_board_info(sdp4430_spi_board_info, ARRAY_SIZE(sdp4430_spi_board_info)); } status = omap4_keyboard_init(&sdp4430_keypad_data); if (status) pr_err("Keypad initialization failed: %d\n", status); omap_dmm_init(); omap_4430sdp_display_init(); if (cpu_is_omap446x()) { /* Vsel0 = gpio, vsel1 = gnd */ status = omap_tps6236x_board_setup(true, TPS62361_GPIO, -1, OMAP_PIN_OFF_OUTPUT_HIGH, -1); if (status) pr_err("TPS62361 initialization failed: %d\n", status); } }
static void __init omap4_panda_init(void) { int package = OMAP_PACKAGE_CBS; if (omap_rev() == OMAP4430_REV_ES1_0) package = OMAP_PACKAGE_CBL; omap4_mux_init(board_mux, NULL, package); if (wl12xx_set_platform_data(&omap_panda_wlan_data)) pr_err("error setting wl12xx data\n"); omap4_panda_i2c_init(); platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices)); platform_device_register(&omap_vwlan_device); board_serial_init(); omap4_twl6030_hsmmc_init(mmc); omap4_ehci_init(); usb_musb_init(&musb_board_data); omap4_panda_display_init(); }
static void __init omap_3430sdp_init(void) { int gpio_pendown; omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); omap_board_config = sdp3430_config; omap_board_config_size = ARRAY_SIZE(sdp3430_config); omap3430_i2c_init(); omap_display_init(&sdp3430_dss_data); if (omap_rev() > OMAP3430_REV_ES1_0) gpio_pendown = SDP3430_TS_GPIO_IRQ_SDPV2; else gpio_pendown = SDP3430_TS_GPIO_IRQ_SDPV1; omap_ads7846_init(1, gpio_pendown, 310, NULL); board_serial_init(); usb_musb_init(NULL); board_smc91x_init(); board_flash_init(sdp_flash_partitions, chip_sel_3430, 0); sdp3430_display_init(); enable_board_wakeup_source(); usbhs_init(&usbhs_bdata); }
static void __init omap_3430sdp_init(void) { omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); omap_board_config = sdp3430_config; omap_board_config_size = ARRAY_SIZE(sdp3430_config); omap3_pm_init_cpuidle(omap3_cpuidle_params_table); omap3430_i2c_init(); omap_display_init(&sdp3430_dss_data); if (omap_rev() > OMAP3430_REV_ES1_0) ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2; else ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV1; sdp3430_spi_board_info[0].irq = gpio_to_irq(ts_gpio); spi_register_board_info(sdp3430_spi_board_info, ARRAY_SIZE(sdp3430_spi_board_info)); ads7846_dev_init(); board_serial_init(); usb_musb_init(&musb_board_data); board_smc91x_init(); board_flash_init(sdp_flash_partitions, chip_sel_3430, 0); sdp3430_display_init(); enable_board_wakeup_source(); usbhs_init(&usbhs_bdata); }
static void __init omap_4430sdp_init(void) { int package = OMAP_PACKAGE_CBS; if (omap_rev() == OMAP4430_REV_ES1_0) package = OMAP_PACKAGE_CBL; omap4_mux_init(board_mux, NULL, package); lpddr_init(); omap_board_config = sdp4430_config; omap_board_config_size = ARRAY_SIZE(sdp4430_config); omap_init_board_version(0); omap4_create_board_props(); blaze_pmic_mux_init(); omap4_i2c_init(); /* JossCheng, 20111221, Porting gyro sensor and e-compass {*/ #ifdef CONFIG_MPU_SENSORS_MPU6050B1 mpu6050b1_init(); #endif /* JossCheng, 20111221, Porting gyro sensor and e-compass }*/ //blaze_sensor_init(); // Anvoi, 2011/12/14, Porting Light sensor driver to ICS omap4_als_init(); // Anvoi, 2011/12/14, Porting Light sensor driver to ICS //blaze_touch_init(); omap4_register_ion(); /*SW5, Anvoi, 20111215, Config key VolumeUp/VolumeDown{*/ platform_add_devices(bowser_devices, ARRAY_SIZE(bowser_devices)); /*SW5, Anvoi, 20111215, Config key VolumeUp/VolumeDown}*/ #if defined (CONFIG_TATE_HALL_SENSORS) hall_init(); #endif board_serial_init(); omap4_twl6030_hsmmc_init(mmc); bowser_wifi_init(); omap4_sdp4430_bt_init(); omap4_ehci_ohci_init(); usb_musb_init(&musb_board_data); // BokeeLi, 2011/12/14, Porting proximity driver #ifdef CONFIG_INPUT_PIC12LF1822_PROXIMITY omap4_proximity_init(); #endif // BokeeLi, 2011/12/14, Porting proximity driver /*SW5, Jamestsai, 1213, enable cypress{*/ #if defined(CONFIG_TOUCHSCREEN_CYPRESS_TTSP) || (CONFIG_TOUCHSCREEN_ATMEL_MXT) || defined(CONFIG_TOUCHSCREEN_ATMEL_MXT_MODULE) omap4_touch_init(); #endif /*}SW5, Jamestsai, 1213, enable cypress*/ omap_dmm_init(); //omap_4430sdp_display_init(); bowser_panel_init(); omap_enable_smartreflex_on_init(); if (enable_suspend_off) omap_pm_enable_off_mode(); }
static void __init board_init(void) { int package = OMAP_PACKAGE_CBS; int status; omap_board_config = board_config; omap_board_config_size = ARRAY_SIZE(board_config); board_set_osc_timings(); if (omap_rev() == OMAP4430_REV_ES1_0) package = OMAP_PACKAGE_CBL; omap4_mux_init(board_mux, NULL, package); archos_memory_init(); omap4_i2c_init(); board_buttons_init(); board_xceiv_init(); archos_usb_musb_init(&archos_vbus_info); archos_audio_twl6040_init(&twl6040_codec); archos_accel_mma8453q_init(&board_mma8453q_pdata); archos_compass_init(&board_akm8975_pdata); archos_battery_twl4030_bci_init(&board_bci_data); omap4_leds_init(); platform_add_devices(a101s_devices, ARRAY_SIZE(a101s_devices)); board_touch_init(); wake_lock_init(&st_wk_lock, WAKE_LOCK_SUSPEND, "st_wake_lock"); board_serial_init(); board_wifi_init(); usb_musb_init(&musb_board_data); omap4_twl6030_hsmmc_init(mmc); archos_omap4_ehci_init(); archos_camera_mt9m114_init(); omap_dmm_init(); omap_board_display_init(); archos_hsusb_ext_regulator_init(); enable_board_wakeup_source(); hardware_comp.tps62361 = 1; /* Vsel0 = gpio, vsel1 = gnd */ status = omap_tps6236x_board_setup(true, TPS62361_GPIO, -1, OMAP_PIN_OFF_OUTPUT_HIGH, -1); if (status) pr_err("TPS62361 initialization failed: %d\n", status); omap_enable_smartreflex_on_init(); if (omap_rev() >= OMAP4430_REV_ES2_3) if (enable_suspend_off) omap_pm_enable_off_mode(); }
static int smc_init (void) { volatile immap_t *im = (immap_t *)CFG_IMMR; volatile smc_t *sp; volatile smc_uart_t *up; volatile cbd_t *tbdf, *rbdf; volatile cpm8xx_t *cp = &(im->im_cpm); #if (!defined(CONFIG_8xx_CONS_SMC1)) && (defined(CONFIG_MPC823) || defined(CONFIG_MPC850)) volatile iop8xx_t *ip = (iop8xx_t *)&(im->im_ioport); #endif uint dpaddr; /* initialize pointers to SMC */ sp = (smc_t *) &(cp->cp_smc[SMC_INDEX]); up = (smc_uart_t *) &cp->cp_dparam[PROFF_SMC]; /* Disable transmitter/receiver. */ sp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN); /* Enable SDMA. */ im->im_siu_conf.sc_sdcr = 1; /* clear error conditions */ #ifdef CFG_SDSR im->im_sdma.sdma_sdsr = CFG_SDSR; #else im->im_sdma.sdma_sdsr = 0x83; #endif /* clear SDMA interrupt mask */ #ifdef CFG_SDMR im->im_sdma.sdma_sdmr = CFG_SDMR; #else im->im_sdma.sdma_sdmr = 0x00; #endif #if defined(CONFIG_8xx_CONS_SMC1) /* Use Port B for SMC1 instead of other functions. */ cp->cp_pbpar |= 0x000000c0; cp->cp_pbdir &= ~0x000000c0; cp->cp_pbodr &= ~0x000000c0; #else /* CONFIG_8xx_CONS_SMC2 */ # if defined(CONFIG_MPC823) || defined(CONFIG_MPC850) /* Use Port A for SMC2 instead of other functions. */ ip->iop_papar |= 0x00c0; ip->iop_padir &= ~0x00c0; ip->iop_paodr &= ~0x00c0; # else /* must be a 860 then */ /* Use Port B for SMC2 instead of other functions. */ cp->cp_pbpar |= 0x00000c00; cp->cp_pbdir &= ~0x00000c00; cp->cp_pbodr &= ~0x00000c00; # endif #endif #if defined(CONFIG_FADS) || defined(CONFIG_ADS) /* Enable RS232 */ #if defined(CONFIG_8xx_CONS_SMC1) *((uint *) BCSR1) &= ~BCSR1_RS232EN_1; #else *((uint *) BCSR1) &= ~BCSR1_RS232EN_2; #endif #endif /* CONFIG_FADS */ #if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC) /* Enable Monitor Port Transceiver */ *((uchar *) BCSR0) |= BCSR0_ENMONXCVR ; #endif /* CONFIG_RPXLITE */ /* Set the physical address of the host memory buffers in * the buffer descriptors. */ #ifdef CFG_ALLOC_DPRAM dpaddr = dpram_alloc_align (sizeof(cbd_t)*2 + 2, 8) ; #else dpaddr = CPM_SERIAL_BASE ; #endif /* Allocate space for two buffer descriptors in the DP ram. * For now, this address seems OK, but it may have to * change with newer versions of the firmware. * damm: allocating space after the two buffers for rx/tx data */ rbdf = (cbd_t *)&cp->cp_dpmem[dpaddr]; rbdf->cbd_bufaddr = (uint) (rbdf+2); rbdf->cbd_sc = 0; tbdf = rbdf + 1; tbdf->cbd_bufaddr = ((uint) (rbdf+2)) + 1; tbdf->cbd_sc = 0; /* Set up the uart parameters in the parameter ram. */ up->smc_rbase = dpaddr; up->smc_tbase = dpaddr+sizeof(cbd_t); up->smc_rfcr = SMC_EB; up->smc_tfcr = SMC_EB; #if defined(CONFIG_MBX) board_serial_init(); #endif /* CONFIG_MBX */ /* Set UART mode, 8 bit, no parity, one stop. * Enable receive and transmit. */ sp->smc_smcmr = smcr_mk_clen(9) | SMCMR_SM_UART; /* Mask all interrupts and remove anything pending. */ sp->smc_smcm = 0; sp->smc_smce = 0xff; /* Set up the baud rate generator. */ smc_setbrg (); /* Make the first buffer the only buffer. */ tbdf->cbd_sc |= BD_SC_WRAP; rbdf->cbd_sc |= BD_SC_EMPTY | BD_SC_WRAP; /* Single character receive. */ up->smc_mrblr = 1; up->smc_maxidl = 0; /* Initialize Tx/Rx parameters. */ while (cp->cp_cpcr & CPM_CR_FLG) /* wait if cp is busy */ ; cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_SMC, CPM_CR_INIT_TRX) | CPM_CR_FLG; while (cp->cp_cpcr & CPM_CR_FLG) /* wait if cp is busy */ ; /* Enable transmitter/receiver. */ sp->smc_smcmr |= SMCMR_REN | SMCMR_TEN; return (0); }
static void smc_init (int smc_index) { static int cpm_cr_ch[] = { CPM_CR_CH_SMC1, CPM_CR_CH_SMC2 }; volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; volatile smc_t *sp; volatile smc_uart_t *up; volatile cbd_t *tbdf, *rbdf; volatile cpm8xx_t *cp = &(im->im_cpm); uint dpaddr; /* initialize pointers to SMC */ sp = (smc_t *) & (cp->cp_smc[smc_index]); up = (smc_uart_t *) & cp->cp_dparam[proff_smc[smc_index]]; /* Disable transmitter/receiver. */ sp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN); /* Enable SDMA. */ im->im_siu_conf.sc_sdcr = 1; /* clear error conditions */ #ifdef CONFIG_SYS_SDSR im->im_sdma.sdma_sdsr = CONFIG_SYS_SDSR; #else im->im_sdma.sdma_sdsr = 0x83; #endif /* clear SDMA interrupt mask */ #ifdef CONFIG_SYS_SDMR im->im_sdma.sdma_sdmr = CONFIG_SYS_SDMR; #else im->im_sdma.sdma_sdmr = 0x00; #endif #if defined(CONFIG_FADS) /* Enable RS232 */ *((uint *) BCSR1) &= ~(smc_index == 1 ? BCSR1_RS232EN_1 : BCSR1_RS232EN_2); #endif #if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC) /* Enable Monitor Port Transceiver */ *((uchar *) BCSR0) |= BCSR0_ENMONXCVR; #endif /* Set the physical address of the host memory buffers in * the buffer descriptors. */ #ifdef CONFIG_SYS_ALLOC_DPRAM dpaddr = dpram_alloc_align (sizeof (cbd_t) * 2 + 2, 8); #else dpaddr = CPM_POST_BASE; #endif /* Allocate space for two buffer descriptors in the DP ram. * For now, this address seems OK, but it may have to * change with newer versions of the firmware. * damm: allocating space after the two buffers for rx/tx data */ rbdf = (cbd_t *) & cp->cp_dpmem[dpaddr]; rbdf->cbd_bufaddr = (uint) (rbdf + 2); rbdf->cbd_sc = 0; tbdf = rbdf + 1; tbdf->cbd_bufaddr = ((uint) (rbdf + 2)) + 1; tbdf->cbd_sc = 0; /* Set up the uart parameters in the parameter ram. */ up->smc_rbase = dpaddr; up->smc_tbase = dpaddr + sizeof (cbd_t); up->smc_rfcr = SMC_EB; up->smc_tfcr = SMC_EB; #if defined(CONFIG_MBX) board_serial_init (); #endif /* Set UART mode, 8 bit, no parity, one stop. * Enable receive and transmit. * Set local loopback mode. */ sp->smc_smcmr = smcr_mk_clen (9) | SMCMR_SM_UART | (ushort) 0x0004; /* Mask all interrupts and remove anything pending. */ sp->smc_smcm = 0; sp->smc_smce = 0xff; /* Set up the baud rate generator. */ cp->cp_simode = 0x00000000; cp->cp_brgc1 = (((gd->cpu_clk / 16 / gd->baudrate) - 1) << 1) | CPM_BRG_EN; /* Make the first buffer the only buffer. */ tbdf->cbd_sc |= BD_SC_WRAP; rbdf->cbd_sc |= BD_SC_EMPTY | BD_SC_WRAP; /* Single character receive. */ up->smc_mrblr = 1; up->smc_maxidl = 0; /* Initialize Tx/Rx parameters. */ while (cp->cp_cpcr & CPM_CR_FLG) /* wait if cp is busy */ ; cp->cp_cpcr = mk_cr_cmd (cpm_cr_ch[smc_index], CPM_CR_INIT_TRX) | CPM_CR_FLG; while (cp->cp_cpcr & CPM_CR_FLG) /* wait if cp is busy */ ; /* Enable transmitter/receiver. */ sp->smc_smcmr |= SMCMR_REN | SMCMR_TEN; }
static void __init omap_4430sdp_init(void) { int status; int package = OMAP_PACKAGE_CBS; if (omap_rev() == OMAP4430_REV_ES1_0) package = OMAP_PACKAGE_CBL; omap4_mux_init(board_mux, NULL, package); if (cpu_is_omap447x()) omap_emif_setup_device_details(&emif_devices_4470, &emif_devices_4470); else omap_emif_setup_device_details(&emif_devices, &emif_devices); omap_board_config = sdp4430_config; omap_board_config_size = ARRAY_SIZE(sdp4430_config); omap_init_board_version(0); omap4_audio_conf(); omap4_create_board_props(); blaze_pmic_mux_init(); blaze_set_osc_timings(); omap4_i2c_init(); blaze_sensor_init(); blaze_touch_init(); omap4_register_ion(); platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); wake_lock_init(&st_wk_lock, WAKE_LOCK_SUSPEND, "st_wake_lock"); board_serial_init(); omap4_sdp4430_wifi_init(); omap4_twl6030_hsmmc_init(mmc); /* blaze_modem_init shall be called before omap4_ehci_ohci_init */ if (!strcmp(modem_ipc, "hsi")) blaze_modem_init(true); else blaze_modem_init(false); omap4_ehci_ohci_init(); usb_musb_init(&musb_board_data); status = omap_ethernet_init(); if (status) { pr_err("Ethernet initialization failed: %d\n", status); } else { sdp4430_spi_board_info[0].irq = gpio_to_irq(ETH_KS8851_IRQ); spi_register_board_info(sdp4430_spi_board_info, ARRAY_SIZE(sdp4430_spi_board_info)); } status = omap4_keyboard_init(&sdp4430_keypad_data); if (status) pr_err("Keypad initialization failed: %d\n", status); omap_dmm_init(); omap_4430sdp_display_init(); blaze_panel_init(); blaze_keypad_init(); init_duty_governor(); if (cpu_is_omap446x()) { /* Vsel0 = gpio, vsel1 = gnd */ status = omap_tps6236x_board_setup(true, TPS62361_GPIO, -1, OMAP_PIN_OFF_OUTPUT_HIGH, -1); if (status) pr_err("TPS62361 initialization failed: %d\n", status); } omap_enable_smartreflex_on_init(); if (enable_suspend_off) omap_pm_enable_off_mode(); }
static int smc_init (void) { volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR; volatile smc_t *sp; volatile smc_uart_t *up; volatile cpm8xx_t *cp = &(im->im_cpm); #if (!defined(CONFIG_8xx_CONS_SMC1)) && (defined(CONFIG_MPC823) || defined(CONFIG_MPC850)) volatile iop8xx_t *ip = (iop8xx_t *)&(im->im_ioport); #endif uint dpaddr; volatile serialbuffer_t *rtx; /* initialize pointers to SMC */ sp = (smc_t *) &(cp->cp_smc[SMC_INDEX]); up = (smc_uart_t *) &cp->cp_dparam[PROFF_SMC]; #ifdef CONFIG_SYS_SMC_UCODE_PATCH up = (smc_uart_t *) &cp->cp_dpmem[up->smc_rpbase]; #else /* Disable relocation */ up->smc_rpbase = 0; #endif /* Disable transmitter/receiver. */ sp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN); /* Enable SDMA. */ im->im_siu_conf.sc_sdcr = 1; /* clear error conditions */ #ifdef CONFIG_SYS_SDSR im->im_sdma.sdma_sdsr = CONFIG_SYS_SDSR; #else im->im_sdma.sdma_sdsr = 0x83; #endif /* clear SDMA interrupt mask */ #ifdef CONFIG_SYS_SDMR im->im_sdma.sdma_sdmr = CONFIG_SYS_SDMR; #else im->im_sdma.sdma_sdmr = 0x00; #endif #if defined(CONFIG_8xx_CONS_SMC1) /* Use Port B for SMC1 instead of other functions. */ cp->cp_pbpar |= 0x000000c0; cp->cp_pbdir &= ~0x000000c0; cp->cp_pbodr &= ~0x000000c0; #else /* CONFIG_8xx_CONS_SMC2 */ # if defined(CONFIG_MPC823) || defined(CONFIG_MPC850) /* Use Port A for SMC2 instead of other functions. */ ip->iop_papar |= 0x00c0; ip->iop_padir &= ~0x00c0; ip->iop_paodr &= ~0x00c0; # else /* must be a 860 then */ /* Use Port B for SMC2 instead of other functions. */ cp->cp_pbpar |= 0x00000c00; cp->cp_pbdir &= ~0x00000c00; cp->cp_pbodr &= ~0x00000c00; # endif #endif #if defined(CONFIG_FADS) || defined(CONFIG_ADS) /* Enable RS232 */ #if defined(CONFIG_8xx_CONS_SMC1) *((uint *) BCSR1) &= ~BCSR1_RS232EN_1; #else *((uint *) BCSR1) &= ~BCSR1_RS232EN_2; #endif #endif /* CONFIG_FADS */ #if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC) /* Enable Monitor Port Transceiver */ *((uchar *) BCSR0) |= BCSR0_ENMONXCVR ; #endif /* CONFIG_RPXLITE */ /* Set the physical address of the host memory buffers in * the buffer descriptors. */ #ifdef CONFIG_SYS_ALLOC_DPRAM /* allocate * size of struct serialbuffer with bd rx/tx, buffer rx/tx and rx index */ dpaddr = dpram_alloc_align((sizeof(serialbuffer_t)), 8); #else dpaddr = CPM_SERIAL_BASE ; #endif rtx = (serialbuffer_t *)&cp->cp_dpmem[dpaddr]; /* Allocate space for two buffer descriptors in the DP ram. * For now, this address seems OK, but it may have to * change with newer versions of the firmware. * damm: allocating space after the two buffers for rx/tx data */ rtx->rxbd.cbd_bufaddr = (uint) &rtx->rxbuf; rtx->rxbd.cbd_sc = 0; rtx->txbd.cbd_bufaddr = (uint) &rtx->txbuf; rtx->txbd.cbd_sc = 0; /* Set up the uart parameters in the parameter ram. */ up->smc_rbase = dpaddr; up->smc_tbase = dpaddr+sizeof(cbd_t); up->smc_rfcr = SMC_EB; up->smc_tfcr = SMC_EB; #if defined (CONFIG_SYS_SMC_UCODE_PATCH) up->smc_rbptr = up->smc_rbase; up->smc_tbptr = up->smc_tbase; up->smc_rstate = 0; up->smc_tstate = 0; #endif #if defined(CONFIG_MBX) board_serial_init(); #endif /* CONFIG_MBX */ /* Set UART mode, 8 bit, no parity, one stop. * Enable receive and transmit. */ sp->smc_smcmr = smcr_mk_clen(9) | SMCMR_SM_UART; /* Mask all interrupts and remove anything pending. */ sp->smc_smcm = 0; sp->smc_smce = 0xff; #ifdef CONFIG_SYS_SPC1920_SMC1_CLK4 /* clock source is PLD */ /* set freq to 19200 Baud */ *((volatile uchar *) CONFIG_SYS_SPC1920_PLD_BASE+6) = 0x3; /* configure clk4 as input */ im->im_ioport.iop_pdpar |= 0x800; im->im_ioport.iop_pddir &= ~0x800; cp->cp_simode = ((cp->cp_simode & ~0xf000) | 0x7000); #else /* Set up the baud rate generator */ smc_setbrg (); #endif /* Make the first buffer the only buffer. */ rtx->txbd.cbd_sc |= BD_SC_WRAP; rtx->rxbd.cbd_sc |= BD_SC_EMPTY | BD_SC_WRAP; /* single/multi character receive. */ up->smc_mrblr = CONFIG_SYS_SMC_RXBUFLEN; up->smc_maxidl = CONFIG_SYS_MAXIDLE; rtx->rxindex = 0; /* Initialize Tx/Rx parameters. */ while (cp->cp_cpcr & CPM_CR_FLG) /* wait if cp is busy */ ; cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_SMC, CPM_CR_INIT_TRX) | CPM_CR_FLG; while (cp->cp_cpcr & CPM_CR_FLG) /* wait if cp is busy */ ; /* Enable transmitter/receiver. */ sp->smc_smcmr |= SMCMR_REN | SMCMR_TEN; return (0); }