예제 #1
0
static void __init bahamas_fixup(struct machine_desc *desc, struct tag *tags,
                               char **cmdline, struct meminfo *mi)
{
	/*CC090319*/

	hwid = 0;
	skuid = 0;
	engineerid = (0x01 << 1);

	hwid = parse_tag_hwid((const struct tag *)tags);
	printk("bahamas_fixup:hwid=0x%x\n", hwid);
	skuid = parse_tag_skuid((const struct tag *)tags);
	printk("bahamas_fixup:skuid=0x%x\n", skuid);
	engineerid = parse_tag_engineerid((const struct tag *)tags);
	printk("bahamas_fixup:engineerid=0x%x\n", engineerid);
	parse_tag_monodie((const struct tag *)tags);
	/*~CC090319*/

	if (board_mcp_monodie()) {
		mi->nr_banks=1;
		mi->bank[0].start = MSM_LINUX_BASE1;
		mi->bank[0].node = PHYS_TO_NID(MSM_LINUX_BASE1);
		mi->bank[0].size = MSM_LINUX_SIZE1+MSM_LINUX_SIZE2;
	}
	else {
		mi->nr_banks=2;
		mi->bank[0].start = MSM_LINUX_BASE1;
		mi->bank[0].node = PHYS_TO_NID(MSM_LINUX_BASE1);
		mi->bank[0].size = MSM_LINUX_SIZE1;
		mi->bank[1].start = MSM_LINUX_BASE2_DUALDIE;
		mi->bank[1].node = PHYS_TO_NID(MSM_LINUX_BASE2_DUALDIE);
		mi->bank[1].size = MSM_LINUX_SIZE2;
	}
}
예제 #2
0
static void __init desirec_fixup(struct machine_desc *desc, struct tag *tags,
                                 char **cmdline, struct meminfo *mi)
{
    parse_tag_monodie((const struct tag *)tags);

    mi->nr_banks = 1;
    mi->bank[0].start = MSM_LINUX_BASE1;
    mi->bank[0].node = PHYS_TO_NID(MSM_LINUX_BASE1);
    if (board_mcp_monodie()) {
        mi->bank[0].size = MSM_LINUX_SIZE1 + MSM_LINUX_SIZE2;
    } else {
        mi->nr_banks = 2;
        mi->bank[0].size = MSM_LINUX_SIZE1;
        mi->bank[1].start = MSM_LINUX_BASE2;
        mi->bank[1].node = PHYS_TO_NID(MSM_LINUX_BASE2);
        mi->bank[1].size = MSM_LINUX_SIZE2;
    }
}
static void __init bahamas_fixup(struct machine_desc *desc, struct tag *tags,
				char **cmdline, struct meminfo *mi)
{
	if (board_mcp_monodie()) {
		mi->nr_banks=1;
		mi->bank[0].start = MSM_LINUX_BASE1;
		mi->bank[0].node = PHYS_TO_NID(MSM_LINUX_BASE1);
		mi->bank[0].size = MSM_LINUX_SIZE1+MSM_LINUX_SIZE2;
	}
	else {
		mi->nr_banks=2;
		mi->bank[0].start = MSM_LINUX_BASE1;
		mi->bank[0].node = PHYS_TO_NID(MSM_LINUX_BASE1);
		mi->bank[0].size = MSM_LINUX_SIZE1;
		mi->bank[1].start = MSM_LINUX_BASE2_DUALDIE;
		mi->bank[1].node = PHYS_TO_NID(MSM_LINUX_BASE2_DUALDIE);
		mi->bank[1].size = MSM_LINUX_SIZE2;
	}
}
예제 #4
0
static void __init bahamas_init(void)
{
	int rc;
	printk("bahamas_init() revision=%d\n", system_rev);

	/*
	 * Setup common MSM GPIOS
	 */
	sdc1_boot_reset();
//        printk("\n\nboard-mega.c: sdc1 boot reset\n\n");

	config_gpios();
//        printk("\n\nboard-mega.c: config gpios\n\n");

	msm_hw_reset_hook = bahamas_reset;
//        printk("\n\nboard-mega.c: msm hw reset hook\n\n");

	msm_acpu_clock_init(&bahamas_clock_data);
//        printk("\n\nmsm acpu clock init\n\n");
	perflock_init(&bahamas_perflock_data);
//        printk("\n\nperflock init\n\n");
	/* adjust GPIOs based on bootloader request */
	/* XXX: on Memphis,
	 *      GPIO#86 is H2W DAT / UART RX for HTC 11-Pin
	 *      GPIO#87 is H2W CLK / UART TX for HTC 11-Pin
	 *      We would need to use UART3 as debug port
	 *
	 * TODO: switch UART3 and H2W (for headset detect)
	 *       based on bootloader request.
	 */

/*#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
	if (!opt_disable_uart3)
		msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3,
				      &msm_device_uart3.dev, 1);
#endif*/


	/* touchscreen must be powered before we enable i2c pullup */
#if 0 /* TODO: do some equivalent operations here */
	udelay(50);
	trout_gpio_write(NULL, TROUT_GPIO_I2C_PULL, 1);
#endif

	/* put the AF VCM in powerdown mode to avoid noise */
#if 0
	trout_gpio_write(NULL, TROUT_GPIO_VCM_PWDN, 1);
	mdelay(100);
	trout_i2c_sysdev_resume(NULL);
#endif

#if 0 /* TODO: do some equivalent operations here */
	if(sysdev_class_register(&trout_i2c_sysdev_class) == 0)
		sysdev_register(&trout_i2c_sys_device);
#endif

	#ifdef CONFIG_SERIAL_MSM_HS
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
	msm_add_serial_devices(3);
	#else
	msm_add_serial_devices(0);
	#endif

	msm_add_serial_devices(2);

	msm_add_usb_devices(NULL,NULL);

	//msm_change_usb_id(0x0bb4, 0x0c06);
	if (board_mcp_monodie())
		msm_add_mem_devices(&pmem_setting_monodie);
	else
		msm_add_mem_devices(&pmem_setting_dualdie);
	msm_init_pmic_vibrator();
//        printk("\n\nboard-mega.c: msm init pmic vibrator\n\n");

	bahamas_init_h2w_power_gpio();
//        printk("\n\nboard-mega.c: bahamas init h2w power gpio\n\n");
//#if 1
	rc = bahamas_init_mmc(system_rev);
//        printk("\n\nboard-mega.c: init mmc\n\n");
	if (rc)
		printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc);
//#endif
	if(!system_rev)
		bahamas_reset_keys_device.dev.platform_data = &bahamas_reset_keys_pdata0;
	/*CC090319*/
/*	if  (bahamas_is_3M_camera())   {
		msm_camera_device_data.sinfo = &msm_camera_sensor_mt9t013;
		}
	else  {
		msm_camera_device_data.sinfo = &msm_camera_sensor_s5k4b2fx;
	}*/

	if(system_rev < 3) {
		if (panel_detect() == PANEL_WINTEK) {
			microp_data.num_pins   = ARRAY_SIZE(microp_pins_0_wint);
			microp_data.pin_config = microp_pins_0_wint;
		} else {
			microp_data.num_pins   = ARRAY_SIZE(microp_pins_0);
			microp_data.pin_config = microp_pins_0;
		}
		i2c_microp_devices.irq = 0;
	} else if (panel_detect() == PANEL_WINTEK) {
		microp_data.num_pins   = ARRAY_SIZE(microp_pins_1_wint);
		microp_data.pin_config = microp_pins_1_wint;
	}

/*~CC090319*/
	//platform_add_devices(devices, ARRAY_SIZE(devices));

	/* Read Config 8 200 (Full Speed USB Mode) */
	/*if (readl(MSM_SHARED_RAM_BASE + 0xFC054) & 0x200)
		bahamas_h2w_data.flags |= FULL_SPEED_USB;

	if (system_rev >= 3)
		bahamas_h2w_data.flags |= _35MM_MIC_DET_L2H;

/*	if (system_rev >= 5)
		i2c_register_board_info(0, i2c_sensor, ARRAY_SIZE(i2c_sensor));

	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
	i2c_register_board_info(0 ,&i2c_microp_devices, 1);

	/* SD card door should wake the device */
	//trout_gpio_irq_set_wake(TROUT_GPIO_TO_INT(TROUT_GPIO_SD_DOOR_N), 1);
	msm_hsusb_set_vbus_state(1);
}
static void __init bahamas_init(void)
{
	int rc;
	char *cid = NULL;

	printk("bahamas_init() revision = 0x%X\n", system_rev);
	printk(KERN_INFO "mfg_mode=%d\n", board_mfg_mode());
	msm_clock_init();
	board_get_cid_tag(&cid);

	/*
	* Setup common MSM GPIOS
	*/
	config_gpios();

	gpio_request(BAHAMAS_GPIO_CABLE_IN2, "gpio_cable_in2");
	gpio_request(BAHAMAS_GPIO_AUD_EXTMIC_SEL, "gpio_aud_extmic_sel");
	gpio_request(BAHAMAS_GPIO_WFM_ANT_SW, "gpio_wfm_ant_sw");

	msm_hw_reset_hook = bahamas_reset;

	msm_acpu_clock_init(&bahamas_clock_data);
#if defined(CONFIG_PERFLOCK)
	perflock_init(&bahamas_perflock_data);
#endif

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
	if (!opt_disable_uart3)
		msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3,
			&msm_device_uart3.dev, 1,
				MSM_GPIO_TO_INT(BAHAMAS_GPIO_UART3_RX));
#endif

	msm_add_devices();

#if defined(CONFIG_SERIAL_MSM_HS)
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
	msm_add_serial_devices(3);
#else
	msm_add_serial_devices(0);
#endif

	msm_add_serial_devices(2);
#if defined(CONFIG_USB_FUNCTION)
	msm_register_usb_phy_init_seq(bahamas_phy_init_seq);
	msm_add_usb_devices(bahamas_phy_reset, NULL);
#endif

#if defined(CONFIG_USB_ANDROID)
	android_usb_pdata.products[0].product_id =
		android_usb_pdata.product_id;
	android_usb_pdata.serial_number = board_serialno();
	msm_hsusb_pdata.serial_number = board_serialno();
	msm_device_hsusb.dev.platform_data = &msm_hsusb_pdata;
	platform_device_register(&msm_device_hsusb);
#if defined(CONFIG_USB_ANDROID_RNDIS)
	platform_device_register(&rndis_device);
#endif
	platform_device_register(&usb_mass_storage_device);
	platform_device_register(&android_usb_device);
#endif
	if (board_mcp_monodie())
		msm_add_mem_devices(&pmem_setting_monodie);
	else
		msm_add_mem_devices(&pmem_setting_dualdie);

	bahamas_init_h2w_power_gpio();

	rc = bahamas_init_mmc(system_rev);
	if (rc)
		printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc);

	if(system_rev < 3) {
		if (panel_detect() == PANEL_WINTEK) {
			microp_data.num_pins	= ARRAY_SIZE(microp_pins_0_wint);
			microp_data.pin_config	= microp_pins_0_wint;
		} else {
			microp_data.num_pins	= ARRAY_SIZE(microp_pins_0);
			microp_data.pin_config	= microp_pins_0;
		}
			i2c_microp_devices.irq = 0;
		} else if (panel_detect() == PANEL_WINTEK) {
			microp_data.num_pins	= ARRAY_SIZE(microp_pins_1_wint);
			microp_data.pin_config	= microp_pins_1_wint;
	}

	msm_device_i2c_init();
	platform_add_devices(devices, ARRAY_SIZE(devices));

	if (system_rev >= 3)
		bahamas_h2w_data.flags |= _35MM_MIC_DET_L2H;

	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
	i2c_register_board_info(0 ,&i2c_microp_devices, 1);

	bahamas_init_keypad();
	bahamas_init_panel();

	msm_init_pmic_vibrator(3000);
}
예제 #6
0
static void __init desirec_init(void)
{
    int rc;
    struct kobject *properties_kobj;
    printk(KERN_INFO "%s() revision = %d\n", __func__, system_rev);

    config_gpios();

    if (system_rev > 0) {
        /* We need to set this pin to 0 only once on power-up; we will
         * not actually enable the chip until we apply power to it via
         * vreg.
         */
        gpio_direction_output(DESIREC_GPIO_CM3602_EN, 0);
        /* disable power for cm3602 chip */
        __capella_cm3602_power(0);
    }

    msm_hw_reset_hook = desirec_reset;

    msm_acpu_clock_init(&desirec_clock_data);
    perflock_init(&desirec_perflock_data);

#if defined(CONFIG_MSM_SERIAL_DEBUGGER)
    if (!opt_disable_uart3)
        msm_serial_debug_init(MSM_UART3_PHYS, INT_UART3,
                              &msm_device_uart3.dev, 1, INT_UART3_RX);
#endif

    msm_add_devices();

    clear_bluetooth_rx_irq_status();

#ifdef CONFIG_SERIAL_MSM_HS
    msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
    msm_add_serial_devices(MSM_SERIAL_UART1DM);
#else
    msm_add_serial_devices(MSM_SERIAL_UART1);
#endif

    msm_add_serial_devices(MSM_SERIAL_UART3);

    msm_add_usb_devices(desirec_phy_reset, desirec_phy_shutdown);

    if (board_mcp_monodie())
        msm_add_mem_devices(&pmem_mono_die_setting);
    else
        msm_add_mem_devices(&pmem_dual_die_setting);

    msm_init_pmic_vibrator();

    rc = desirec_init_mmc(system_rev);
    if (rc)
        printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc);

    properties_kobj = kobject_create_and_add("board_properties", NULL);
    if (properties_kobj)
        rc = sysfs_create_group(properties_kobj,
                                &desirec_properties_attr_group);
    if (!properties_kobj || rc)
        pr_err("failed to create board_properties\n");

    msm_device_i2c.dev.platform_data = &desirec_i2c_device_data;

    if (system_rev > 0) /*Aobve XB*/
        platform_add_devices(devices, ARRAY_SIZE(devices));
    else /* XA */
        platform_add_devices(devices0, ARRAY_SIZE(devices0));

    if (system_rev > 0) {
        microp_data.ls_power = capella_cm3602_power;
        if (system_rev >= 2) {
            microp_data.num_pins = ARRAY_SIZE(microp_pins_2);
            microp_data.pin_config = microp_pins_2;
        }
    }

    i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
    /* r porting*///	i2c_register_board_info(0, &i2c_s5k3e2fx, 1);
}