3 * Copyright (C) 2012 ROCKCHIP, Inc.
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
16 #include <linux/kernel.h>
17 #include <linux/init.h>
18 #include <linux/platform_device.h>
19 #include <linux/input.h>
21 #include <linux/delay.h>
22 #include <linux/i2c.h>
23 #include <linux/skbuff.h>
24 #include <linux/spi/spi.h>
25 #include <linux/mmc/host.h>
26 #include <linux/ion.h>
27 #include <linux/cpufreq.h>
28 #include <linux/clk.h>
29 #include <mach/dvfs.h>
31 #include <asm/setup.h>
32 #include <asm/mach-types.h>
33 #include <asm/mach/arch.h>
34 #include <asm/mach/map.h>
35 #include <asm/mach/flash.h>
36 #include <asm/hardware/gic.h>
38 #include <mach/board.h>
39 #include <mach/hardware.h>
41 #include <mach/gpio.h>
42 #include <mach/iomux.h>
43 #include <linux/rk_fb.h>
44 #include <linux/regulator/machine.h>
45 #include <linux/rfkill-rk.h>
46 #include <linux/sensor-dev.h>
47 #include <linux/mfd/tps65910.h>
48 #include <linux/regulator/act8846.h>
49 #include <linux/regulator/rk29-pwm-regulator.h>
50 #if defined(CONFIG_CT36X_TS)
51 #include <linux/ct36x.h>
53 #if defined(CONFIG_MFD_RK610)
54 #include <linux/mfd/rk610_core.h>
57 #if defined(CONFIG_RK_HDMI)
58 #include "../../../drivers/video/rockchip/hdmi/rk_hdmi.h"
61 #if defined(CONFIG_SPIM_RK29)
62 #include "../../../drivers/spi/rk29_spim.h"
64 #if defined(CONFIG_GPS_RK)
65 #include "../../../drivers/misc/gps/rk_gps/rk_gps.h"
68 #if defined(CONFIG_MT6620)
69 #include <linux/gps.h>
72 #include "board-rk3168-ds1006h-camera.c"
75 static struct rk29_keys_button key_button[] = {
79 .gpio = RK30_PIN0_PA4,
80 .active_low = PRESS_LEV_LOW,
88 .active_low = PRESS_LEV_LOW,
91 struct rk29_keys_platform_data rk29_keys_pdata = {
92 .buttons = key_button,
93 .nbuttons = ARRAY_SIZE(key_button),
94 .chn = 1, //chn: 0-7, if do not use ADC,set 'chn' -1
97 #if defined(CONFIG_CT36X_TS)
99 #define TOUCH_MODEL 363
100 #define TOUCH_MAX_X 1280
101 #define TOUCH_MAX_y 800
102 #define TOUCH_RESET_PIN RK30_PIN0_PB6
103 #define TOUCH_INT_PIN RK30_PIN1_PB7
105 static struct ct36x_platform_data ct36x_info = {
106 .model = TOUCH_MODEL,
107 .x_max = TOUCH_MAX_X,
108 .y_max = TOUCH_MAX_y,
111 .gpio = TOUCH_RESET_PIN,
115 .gpio = TOUCH_INT_PIN,
118 .orientation = {1, 0, 1, 0},
121 static struct spi_board_info board_spi_devices[] = {
124 /***********************************************************
126 ************************************************************/
127 #ifdef CONFIG_BACKLIGHT_RK29_BL
129 #define PWM_MODE PWM3
130 #define PWM_EFFECT_VALUE 1
132 #define LCD_DISP_ON_PIN
134 #ifdef LCD_DISP_ON_PIN
135 #define BL_EN_PIN RK30_PIN0_PA2
136 #define BL_EN_VALUE GPIO_HIGH
138 static int rk29_backlight_io_init(void)
143 #ifdef LCD_DISP_ON_PIN
144 ret = gpio_request(BL_EN_PIN, NULL);
146 gpio_free(BL_EN_PIN);
149 gpio_direction_output(BL_EN_PIN, 0);
150 gpio_set_value(BL_EN_PIN, BL_EN_VALUE);
156 static int rk29_backlight_io_deinit(void)
158 int ret = 0, pwm_gpio;
160 #ifdef LCD_DISP_ON_PIN
161 gpio_free(BL_EN_PIN);
164 pwm_gpio = iomux_mode_to_gpio(PWM_MODE);
165 gpio_request(pwm_gpio, NULL);
166 gpio_direction_output(pwm_gpio, GPIO_LOW);
170 static int rk29_backlight_pwm_suspend(void)
172 int ret = 0, pwm_gpio;
174 pwm_gpio = iomux_mode_to_gpio(PWM_MODE);
175 if (gpio_request(pwm_gpio, NULL)) {
176 printk("func %s, line %d: request gpio fail\n", __FUNCTION__, __LINE__);
179 gpio_direction_output(pwm_gpio, GPIO_LOW);
180 #ifdef LCD_DISP_ON_PIN
181 gpio_direction_output(BL_EN_PIN, 0);
182 gpio_set_value(BL_EN_PIN, !BL_EN_VALUE);
187 static int rk29_backlight_pwm_resume(void)
189 int pwm_gpio = iomux_mode_to_gpio(PWM_MODE);
193 #ifdef LCD_DISP_ON_PIN
195 gpio_direction_output(BL_EN_PIN, 1);
196 gpio_set_value(BL_EN_PIN, BL_EN_VALUE);
201 static struct rk29_bl_info rk29_bl_info = {
202 .min_brightness = 30,
203 .pre_div = 20 * 1000, // pwm output clk: 20k;
205 .bl_ref = PWM_EFFECT_VALUE,
206 .io_init = rk29_backlight_io_init,
207 .io_deinit = rk29_backlight_io_deinit,
208 .pwm_suspend = rk29_backlight_pwm_suspend,
209 .pwm_resume = rk29_backlight_pwm_resume,
212 static struct platform_device rk29_device_backlight = {
213 .name = "rk29_backlight",
216 .platform_data = &rk29_bl_info,
223 #if defined (CONFIG_GS_MMA8452)
224 #define MMA8452_INT_PIN RK30_PIN0_PB7
226 static int mma8452_init_platform_hw(void)
231 static struct sensor_platform_data mma8452_info = {
232 .type = SENSOR_TYPE_ACCEL,
235 .init_platform_hw = mma8452_init_platform_hw,
236 .orientation = {-1, 0, 0, 0, 0, 1, 0, 1, 0},
239 #if defined (CONFIG_GS_LIS3DH)
240 #define LIS3DH_INT_PIN RK30_PIN0_PB7
242 static int lis3dh_init_platform_hw(void)
248 static struct sensor_platform_data lis3dh_info = {
249 .type = SENSOR_TYPE_ACCEL,
252 .init_platform_hw = lis3dh_init_platform_hw,
253 .orientation = {-1, 0, 0, 0, 0, 1, 0, -1, 0},
256 #if defined (CONFIG_COMPASS_AK8975)
257 static struct sensor_platform_data akm8975_info =
259 .type = SENSOR_TYPE_COMPASS,
292 #if defined(CONFIG_GYRO_L3G4200D)
294 #include <linux/l3g4200d.h>
295 #define L3G4200D_INT_PIN RK30_PIN0_PB4
297 static int l3g4200d_init_platform_hw(void)
302 static struct sensor_platform_data l3g4200d_info = {
303 .type = SENSOR_TYPE_GYROSCOPE,
306 .orientation = {0, 1, 0, -1, 0, 0, 0, 0, 1},
307 .init_platform_hw = l3g4200d_init_platform_hw,
308 .x_min = 40,//x_min,y_min,z_min = (0-100) according to hardware
315 #ifdef CONFIG_LS_CM3217
316 static struct sensor_platform_data cm3217_info = {
317 .type = SENSOR_TYPE_LIGHT,
319 .poll_delay_ms = 500,
324 #ifdef CONFIG_FB_ROCKCHIP
326 #define LCD_CS_PIN INVALID_GPIO
327 #define LCD_CS_VALUE GPIO_HIGH
329 #define LCD_EN_PIN RK30_PIN0_PB0
330 #define LCD_EN_VALUE GPIO_LOW
332 static int rk_fb_io_init(struct rk29_fb_setting_info *fb_setting)
336 if(LCD_CS_PIN !=INVALID_GPIO)
338 ret = gpio_request(LCD_CS_PIN, NULL);
341 gpio_free(LCD_CS_PIN);
342 printk(KERN_ERR "request lcd cs pin fail!\n");
347 gpio_direction_output(LCD_CS_PIN, LCD_CS_VALUE);
351 if(LCD_EN_PIN !=INVALID_GPIO)
353 ret = gpio_request(LCD_EN_PIN, NULL);
356 gpio_free(LCD_EN_PIN);
357 printk(KERN_ERR "request lcd en pin fail!\n");
362 gpio_direction_output(LCD_EN_PIN, LCD_EN_VALUE);
367 static int rk_fb_io_disable(void)
369 if(LCD_CS_PIN !=INVALID_GPIO)
371 gpio_set_value(LCD_CS_PIN, !LCD_CS_VALUE);
373 if(LCD_EN_PIN !=INVALID_GPIO)
375 gpio_set_value(LCD_EN_PIN, !LCD_EN_VALUE);
379 static int rk_fb_io_enable(void)
381 if(LCD_CS_PIN !=INVALID_GPIO)
383 gpio_set_value(LCD_CS_PIN, LCD_CS_VALUE);
385 if(LCD_EN_PIN !=INVALID_GPIO)
387 gpio_set_value(LCD_EN_PIN, LCD_EN_VALUE);
392 #if defined(CONFIG_LCDC0_RK3066B)
393 struct rk29fb_info lcdc0_screen_info = {
394 .prop = EXTEND, //primary display device
398 .set_screen_info = NULL,
402 #if defined(CONFIG_LCDC1_RK3066B)
403 struct rk29fb_info lcdc1_screen_info = {
404 .prop = PRMRY, //primary display device
405 .io_init = rk_fb_io_init,
406 .io_disable = rk_fb_io_disable,
407 .io_enable = rk_fb_io_enable,
408 .set_screen_info = set_lcd_info,
413 static struct resource resource_fb[] = {
417 .end = 0,//RK30_FB0_MEM_SIZE - 1,
418 .flags = IORESOURCE_MEM,
421 .name = "ipp buf", //for rotate
423 .end = 0,//RK30_FB0_MEM_SIZE - 1,
424 .flags = IORESOURCE_MEM,
429 .end = 0,//RK30_FB0_MEM_SIZE - 1,
430 .flags = IORESOURCE_MEM,
434 static struct platform_device device_fb = {
437 .num_resources = ARRAY_SIZE(resource_fb),
438 .resource = resource_fb,
442 #if defined(CONFIG_LCDC0_RK3066B)
443 static struct resource resource_lcdc0[] = {
446 .start = RK30_LCDC0_PHYS,
447 .end = RK30_LCDC0_PHYS + RK30_LCDC0_SIZE - 1,
448 .flags = IORESOURCE_MEM,
455 .flags = IORESOURCE_IRQ,
459 static struct platform_device device_lcdc0 = {
462 .num_resources = ARRAY_SIZE(resource_lcdc0),
463 .resource = resource_lcdc0,
465 .platform_data = &lcdc0_screen_info,
469 #if defined(CONFIG_LCDC1_RK3066B)
470 static struct resource resource_lcdc1[] = {
473 .start = RK30_LCDC1_PHYS,
474 .end = RK30_LCDC1_PHYS + RK30_LCDC1_SIZE - 1,
475 .flags = IORESOURCE_MEM,
481 .flags = IORESOURCE_IRQ,
485 static struct platform_device device_lcdc1 = {
488 .num_resources = ARRAY_SIZE(resource_lcdc1),
489 .resource = resource_lcdc1,
491 .platform_data = &lcdc1_screen_info,
496 #if defined(CONFIG_MFD_RK610)
497 #define RK610_RST_PIN RK30_PIN3_PB2
498 static int rk610_power_on_init(void)
501 if(RK610_RST_PIN != INVALID_GPIO)
503 ret = gpio_request(RK610_RST_PIN, "rk610 reset");
506 printk(KERN_ERR "rk610_control_probe request gpio fail\n");
510 gpio_direction_output(RK610_RST_PIN, GPIO_HIGH);
512 gpio_direction_output(RK610_RST_PIN, GPIO_LOW);
514 gpio_set_value(RK610_RST_PIN, GPIO_HIGH);
523 static struct rk610_ctl_platform_data rk610_ctl_pdata = {
524 .rk610_power_on_init = rk610_power_on_init,
528 #ifdef CONFIG_SND_SOC_RK610
529 static int rk610_codec_io_init(void)
532 //Must not gpio_request
536 static struct rk610_codec_platform_data rk610_codec_pdata = {
537 .spk_ctl_io = RK30_PIN2_PD7,
538 .io_init = rk610_codec_io_init,
544 #define ION_RESERVE_SIZE (80 * SZ_1M)
545 static struct ion_platform_data rk30_ion_pdata = {
549 .type = ION_HEAP_TYPE_CARVEOUT,
550 .id = ION_NOR_HEAP_ID,
552 .size = ION_RESERVE_SIZE,
557 static struct platform_device device_ion = {
558 .name = "ion-rockchip",
561 .platform_data = &rk30_ion_pdata,
566 /**************************************************************************************************
567 * SDMMC devices, include the module of SD,MMC,and sdio.noted by xbw at 2012-03-05
568 **************************************************************************************************/
569 #ifdef CONFIG_SDMMC_RK29
570 #include "board-rk3168-ds1006h-sdmmc-config.c"
571 #include "../plat-rk/rk-sdmmc-ops.c"
572 #include "../plat-rk/rk-sdmmc-wifi.c"
573 #endif //endif ---#ifdef CONFIG_SDMMC_RK29
575 #ifdef CONFIG_SDMMC0_RK29
576 static int rk29_sdmmc0_cfg_gpio(void)
578 #ifdef CONFIG_SDMMC_RK29_OLD
580 iomux_set(MMC0_CLKOUT);
586 iomux_set_gpio_mode(iomux_mode_to_gpio(MMC0_DETN));
588 gpio_request(RK30_PIN3_PA7, "sdmmc-power");
589 gpio_direction_output(RK30_PIN3_PA7, GPIO_LOW);
592 rk29_sdmmc_set_iomux(0, 0xFFFF);
594 #if defined(CONFIG_SDMMC0_RK29_SDCARD_DET_FROM_GPIO)
595 #if SDMMC_USE_NEW_IOMUX_API
596 iomux_set_gpio_mode(iomux_gpio_to_mode(RK29SDK_SD_CARD_DETECT_N));
598 rk30_mux_api_set(RK29SDK_SD_CARD_DETECT_PIN_NAME, RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO);
601 #if SDMMC_USE_NEW_IOMUX_API
602 iomux_set(MMC0_DETN);
604 rk30_mux_api_set(RK29SDK_SD_CARD_DETECT_PIN_NAME, RK29SDK_SD_CARD_DETECT_IOMUX_FMUX);
608 #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
609 gpio_request(SDMMC0_WRITE_PROTECT_PIN, "sdmmc-wp");
610 gpio_direction_input(SDMMC0_WRITE_PROTECT_PIN);
618 #define CONFIG_SDMMC0_USE_DMA
619 struct rk29_sdmmc_platform_data default_sdmmc0_data = {
621 (MMC_VDD_25_26 | MMC_VDD_26_27 | MMC_VDD_27_28 | MMC_VDD_28_29 |
622 MMC_VDD_29_30 | MMC_VDD_30_31 | MMC_VDD_31_32 | MMC_VDD_32_33 |
623 MMC_VDD_33_34 | MMC_VDD_34_35 | MMC_VDD_35_36),
625 (MMC_CAP_4_BIT_DATA | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
626 .io_init = rk29_sdmmc0_cfg_gpio,
628 #if !defined(CONFIG_SDMMC_RK29_OLD)
629 .set_iomux = rk29_sdmmc_set_iomux,
632 .dma_name = "sd_mmc",
633 #ifdef CONFIG_SDMMC0_USE_DMA
639 #if defined(CONFIG_WIFI_COMBO_MODULE_CONTROL_FUNC) && defined(CONFIG_USE_SDMMC0_FOR_WIFI_DEVELOP_BOARD)
640 .status = rk29sdk_wifi_mmc0_status,
641 .register_status_notify = rk29sdk_wifi_mmc0_status_register,
644 #if defined(RK29SDK_SD_CARD_PWR_EN) || (INVALID_GPIO != RK29SDK_SD_CARD_PWR_EN)
645 .power_en = RK29SDK_SD_CARD_PWR_EN,
646 .power_en_level = RK29SDK_SD_CARD_PWR_EN_LEVEL,
648 .power_en = INVALID_GPIO,
649 .power_en_level = GPIO_LOW,
651 .enable_sd_wakeup = 0,
653 #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
654 .write_prt = SDMMC0_WRITE_PROTECT_PIN,
655 .write_prt_enalbe_level = SDMMC0_WRITE_PROTECT_ENABLE_VALUE;
657 .write_prt = INVALID_GPIO,
661 #if defined(RK29SDK_SD_CARD_DETECT_N) || (INVALID_GPIO != RK29SDK_SD_CARD_DETECT_N)
662 .io = RK29SDK_SD_CARD_DETECT_N, //INVALID_GPIO,
663 .enable = RK29SDK_SD_CARD_INSERT_LEVEL,
664 #ifdef RK29SDK_SD_CARD_DETECT_PIN_NAME
666 .name = RK29SDK_SD_CARD_DETECT_PIN_NAME,
667 #ifdef RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO
668 .fgpio = RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO,
670 #ifdef RK29SDK_SD_CARD_DETECT_IOMUX_FMUX
671 .fmux = RK29SDK_SD_CARD_DETECT_IOMUX_FMUX,
682 #endif // CONFIG_SDMMC0_RK29
684 #ifdef CONFIG_SDMMC1_RK29
685 #define CONFIG_SDMMC1_USE_DMA
686 static int rk29_sdmmc1_cfg_gpio(void)
688 #if defined(CONFIG_SDMMC_RK29_OLD)
690 iomux_set(MMC1_CLKOUT);
697 #if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
698 gpio_request(SDMMC1_WRITE_PROTECT_PIN, "sdio-wp");
699 gpio_direction_input(SDMMC1_WRITE_PROTECT_PIN);
707 struct rk29_sdmmc_platform_data default_sdmmc1_data = {
709 (MMC_VDD_25_26 | MMC_VDD_26_27 | MMC_VDD_27_28 | MMC_VDD_28_29 |
710 MMC_VDD_29_30 | MMC_VDD_30_31 | MMC_VDD_31_32 | MMC_VDD_32_33 |
713 #if !defined(CONFIG_USE_SDMMC1_FOR_WIFI_DEVELOP_BOARD)
714 .host_caps = (MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ |
715 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
718 (MMC_CAP_4_BIT_DATA | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
721 .io_init = rk29_sdmmc1_cfg_gpio,
723 #if !defined(CONFIG_SDMMC_RK29_OLD)
724 .set_iomux = rk29_sdmmc_set_iomux,
728 #ifdef CONFIG_SDMMC1_USE_DMA
734 #if defined(CONFIG_WIFI_CONTROL_FUNC) || defined(CONFIG_WIFI_COMBO_MODULE_CONTROL_FUNC)
735 .status = rk29sdk_wifi_status,
736 .register_status_notify = rk29sdk_wifi_status_register,
739 #if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
740 .write_prt = SDMMC1_WRITE_PROTECT_PIN,
741 .write_prt_enalbe_level = SDMMC1_WRITE_PROTECT_ENABLE_VALUE;
743 .write_prt = INVALID_GPIO,
746 #if defined(CONFIG_RK29_SDIO_IRQ_FROM_GPIO)
747 .sdio_INT_gpio = RK29SDK_WIFI_SDIO_CARD_INT,
751 #if defined(CONFIG_USE_SDMMC1_FOR_WIFI_DEVELOP_BOARD)
752 #if defined(RK29SDK_SD_CARD_DETECT_N) || (INVALID_GPIO != RK29SDK_SD_CARD_DETECT_N)
753 .io = RK29SDK_SD_CARD_DETECT_N,
758 .enable = RK29SDK_SD_CARD_INSERT_LEVEL,
759 #ifdef RK29SDK_SD_CARD_DETECT_PIN_NAME
761 .name = RK29SDK_SD_CARD_DETECT_PIN_NAME,
762 #ifdef RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO
763 .fgpio = RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO,
765 #ifdef RK29SDK_SD_CARD_DETECT_IOMUX_FMUX
766 .fmux = RK29SDK_SD_CARD_DETECT_IOMUX_FMUX,
776 .enable_sd_wakeup = 0,
778 #endif //endif--#ifdef CONFIG_SDMMC1_RK29
780 /**************************************************************************************************
781 * the end of setting for SDMMC devices
782 **************************************************************************************************/
784 #ifdef CONFIG_BATTERY_RK30_ADC_FAC
785 static struct rk30_adc_battery_platform_data rk30_adc_battery_platdata = {
786 .dc_det_pin = RK30_PIN0_PB2,
787 .batt_low_pin = INVALID_GPIO,
788 .charge_set_pin = INVALID_GPIO,
789 .charge_ok_pin = RK30_PIN0_PA6,
790 .usb_det_pin = INVALID_GPIO,
791 .dc_det_level = GPIO_LOW,
792 .charge_ok_level = GPIO_HIGH,
794 .reference_voltage = 1800, // the rK2928 is 3300;RK3066 and rk29 are 2500;rk3066B is 1800;
795 .pull_up_res = 200, //divider resistance , pull-up resistor
796 .pull_down_res = 120, //divider resistance , pull-down resistor
798 .is_reboot_charging = 1,
800 .low_voltage_protection = 3600,
803 static struct platform_device rk30_device_adc_battery = {
804 .name = "rk30-battery",
807 .platform_data = &rk30_adc_battery_platdata,
811 #ifdef CONFIG_RK30_PWM_REGULATOR
812 static int pwm_voltage_map[] = {
813 800000,825000,850000, 875000,900000, 925000 ,950000, 975000,1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000,1375000
816 static struct regulator_consumer_supply pwm_dcdc1_consumers[] = {
822 struct regulator_init_data pwm_regulator_init_dcdc[1] =
828 .max_uV = 1800000, //0.6-1.8V
830 .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE,
832 .num_consumer_supplies = ARRAY_SIZE(pwm_dcdc1_consumers),
833 .consumer_supplies = pwm_dcdc1_consumers,
837 static struct pwm_platform_data pwm_regulator_info[1] = {
840 .pwm_gpio = RK30_PIN3_PD4,
841 .pwm_iomux_pwm = PWM1,
842 .pwm_iomux_gpio = GPIO3_D4,
843 .pwm_voltage = 1100000,
844 .suspend_voltage = 1000000,
847 .coefficient = 575, //57.5%
848 .pwm_voltage_map = pwm_voltage_map,
849 .init_data = &pwm_regulator_init_dcdc[0],
853 struct platform_device pwm_regulator_device[1] = {
855 .name = "pwm-voltage-regulator",
858 .platform_data = &pwm_regulator_info[0],
864 #ifdef CONFIG_RFKILL_RK
865 // bluetooth rfkill device, its driver in net/rfkill/rfkill-rk.c
866 static struct rfkill_rk_platform_data rfkill_rk_platdata = {
867 .type = RFKILL_TYPE_BLUETOOTH,
869 .poweron_gpio = { // BT_REG_ON
870 .io = INVALID_GPIO, //RK30_PIN3_PC7,
873 .name = "bt_poweron",
878 .reset_gpio = { // BT_RST
879 .io = RK30_PIN3_PD1, // set io to INVALID_GPIO for disable it
887 .wake_gpio = { // BT_WAKE, use to control bt's sleep and wakeup
888 .io = RK30_PIN3_PC6, // set io to INVALID_GPIO for disable it
896 .wake_host_irq = { // BT_HOST_WAKE, for bt wakeup host when it is in deep sleep
898 .io = RK30_PIN0_PA5, // set io to INVALID_GPIO for disable it
899 .enable = GPIO_LOW, // set GPIO_LOW for falling, set 0 for rising
906 .rts_gpio = { // UART_RTS, enable or disable BT's data coming
907 .io = RK30_PIN1_PA3, // set io to INVALID_GPIO for disable it
917 static struct platform_device device_rfkill_rk = {
921 .platform_data = &rfkill_rk_platdata,
926 #if defined(CONFIG_GPS_RK)
927 int rk_gps_io_init(void)
929 printk("%s \n", __FUNCTION__);
931 rk30_mux_api_set(GPIO1B5_UART3RTSN_NAME, GPIO1B_GPIO1B5);//VCC_EN
932 gpio_request(RK30_PIN1_PB5, NULL);
933 gpio_direction_output(RK30_PIN1_PB5, GPIO_LOW);
935 rk30_mux_api_set(GPIO1B4_UART3CTSN_GPSRFCLK_NAME, GPIO1B_GPSRFCLK);//GPS_CLK
936 rk30_mux_api_set(GPIO1B2_UART3SIN_GPSMAG_NAME, GPIO1B_GPSMAG);//GPS_MAG
937 rk30_mux_api_set(GPIO1B3_UART3SOUT_GPSSIG_NAME, GPIO1B_GPSSIG);//GPS_SIGN
939 rk30_mux_api_set(GPIO1A6_UART1CTSN_SPI0CLK_NAME, GPIO1A_GPIO1A6);//SPI_CLK
940 gpio_request(RK30_PIN1_PA6, NULL);
941 gpio_direction_output(RK30_PIN1_PA6, GPIO_LOW);
943 rk30_mux_api_set(GPIO1A5_UART1SOUT_SPI0TXD_NAME, GPIO1A_GPIO1A5);//SPI_MOSI
944 gpio_request(RK30_PIN1_PA5, NULL);
945 gpio_direction_output(RK30_PIN1_PA5, GPIO_LOW);
947 rk30_mux_api_set(GPIO1A7_UART1RTSN_SPI0CSN0_NAME, GPIO1A_GPIO1A7);//SPI_CS
948 gpio_request(RK30_PIN1_PA7, NULL);
949 gpio_direction_output(RK30_PIN1_PA7, GPIO_LOW);
952 int rk_gps_power_up(void)
954 printk("%s \n", __FUNCTION__);
959 int rk_gps_power_down(void)
961 printk("%s \n", __FUNCTION__);
966 int rk_gps_reset_set(int level)
970 int rk_enable_hclk_gps(void)
972 printk("%s \n", __FUNCTION__);
973 clk_enable(clk_get(NULL, "hclk_gps"));
976 int rk_disable_hclk_gps(void)
978 printk("%s \n", __FUNCTION__);
979 clk_disable(clk_get(NULL, "hclk_gps"));
982 struct rk_gps_data rk_gps_info = {
983 .io_init = rk_gps_io_init,
984 .power_up = rk_gps_power_up,
985 .power_down = rk_gps_power_down,
986 .reset = rk_gps_reset_set,
987 .enable_hclk_gps = rk_enable_hclk_gps,
988 .disable_hclk_gps = rk_disable_hclk_gps,
989 .GpsSign = RK30_PIN1_PB3,
990 .GpsMag = RK30_PIN1_PB2, //GPIO index
991 .GpsClk = RK30_PIN1_PB4, //GPIO index
992 .GpsVCCEn = RK30_PIN1_PB5, //GPIO index
993 .GpsSpi_CSO = RK30_PIN1_PA4, //GPIO index
994 .GpsSpiClk = RK30_PIN1_PA5, //GPIO index
995 .GpsSpiMOSI = RK30_PIN1_PA7, //GPIO index
999 .u32GpsPhyAddr = RK30_GPS_PHYS,
1000 .u32GpsPhySize = RK30_GPS_SIZE,
1003 struct platform_device rk_device_gps = {
1004 .name = "gps_hv5820b",
1007 .platform_data = &rk_gps_info,
1012 #if defined(CONFIG_MT5931_MT6622)
1013 static struct mt6622_platform_data mt6622_platdata = {
1014 .power_gpio = { // BT_REG_ON
1015 .io = RK30_PIN3_PD5, // set io to INVALID_GPIO for disable it
1016 .enable = GPIO_HIGH,
1022 .reset_gpio = { // BT_RST
1023 .io = RK30_PIN0_PD7,
1024 .enable = GPIO_HIGH,
1031 .io = RK30_PIN3_PD2,
1032 .enable = GPIO_HIGH,
1039 static struct platform_device device_mt6622 = {
1043 .platform_data = &mt6622_platdata,
1048 static struct platform_device *devices[] __initdata = {
1053 #ifdef CONFIG_WIFI_CONTROL_FUNC
1054 &rk29sdk_wifi_device,
1057 #if defined(CONFIG_MT6620)
1061 #ifdef CONFIG_BATTERY_RK30_ADC_FAC
1062 &rk30_device_adc_battery,
1064 #ifdef CONFIG_RFKILL_RK
1067 #ifdef CONFIG_GPS_RK
1070 #ifdef CONFIG_MT5931_MT6622
1076 static int rk_platform_add_display_devices(void)
1078 struct platform_device *fb = NULL; //fb
1079 struct platform_device *lcdc0 = NULL; //lcdc0
1080 struct platform_device *lcdc1 = NULL; //lcdc1
1081 struct platform_device *bl = NULL; //backlight
1082 #ifdef CONFIG_FB_ROCKCHIP
1086 #if defined(CONFIG_LCDC0_RK3066B)
1087 lcdc0 = &device_lcdc0,
1090 #if defined(CONFIG_LCDC1_RK3066B)
1091 lcdc1 = &device_lcdc1,
1094 #ifdef CONFIG_BACKLIGHT_RK29_BL
1095 bl = &rk29_device_backlight,
1097 __rk_platform_add_display_devices(fb,lcdc0,lcdc1,bl);
1104 #ifdef CONFIG_I2C0_RK30
1105 static struct i2c_board_info __initdata i2c0_info[] = {
1106 #if defined (CONFIG_GS_MMA8452)
1108 .type = "gs_mma8452",
1111 .irq = MMA8452_INT_PIN,
1112 .platform_data = &mma8452_info,
1115 #if defined (CONFIG_GS_LIS3DH)
1117 .type = "gs_lis3dh",
1118 .addr = 0x19, //0x19(SA0-->VCC), 0x18(SA0-->GND)
1120 .irq = LIS3DH_INT_PIN,
1121 .platform_data = &lis3dh_info,
1124 #if defined (CONFIG_COMPASS_AK8975)
1129 .irq = RK30_PIN3_PD7,
1130 .platform_data = &akm8975_info,
1131 .irq = RK30_PIN3_PD7,
1132 .platform_data = &akm8975_info,
1135 #if defined (CONFIG_GYRO_L3G4200D)
1137 .type = "l3g4200d_gryo",
1140 .irq = L3G4200D_INT_PIN,
1141 .platform_data = &l3g4200d_info,
1144 #if defined (CONFIG_SND_SOC_RK1000)
1146 .type = "rk1000_i2c_codec",
1151 .type = "rk1000_control",
1156 #if defined (CONFIG_SND_SOC_RT5631)
1166 int __sramdata g_pmic_type = 0;
1167 #ifdef CONFIG_I2C1_RK30
1168 #ifdef CONFIG_REGULATOR_ACT8846
1169 #define PMU_POWER_SLEEP RK30_PIN0_PA1
1170 #define ACT8846_HOST_IRQ RK30_PIN0_PB3
1172 static struct pmu_info act8846_dcdc_info[] = {
1174 .name = "act_dcdc1", //ddr
1177 .suspend_vol = 1200000,
1180 .name = "vdd_core", //logic
1183 #ifdef CONFIG_ACT8846_SUPPORT_RESET
1184 .suspend_vol = 1200000,
1186 .suspend_vol = 900000,
1190 .name = "vdd_cpu", //arm
1193 #ifdef CONFIG_ACT8846_SUPPORT_RESET
1194 .suspend_vol = 1200000,
1196 .suspend_vol = 900000,
1200 .name = "act_dcdc4", //vccio
1203 #ifdef CONFIG_ACT8846_SUPPORT_RESET
1204 .suspend_vol = 3000000,
1206 .suspend_vol = 2800000,
1211 static struct pmu_info act8846_ldo_info[] = {
1213 .name = "act_ldo1", //vdd10
1218 .name = "act_ldo2", //vdd12
1223 .name = "act_ldo3", //vcc18_cif
1228 .name = "act_ldo4", //vcca33
1233 .name = "act_ldo5", //vcctp
1238 .name = "act_ldo6", //vcc_jetta
1243 .name = "act_ldo7", //vcc18
1248 .name = "act_ldo8", //vcc28_cif
1254 #include "board-pmu-act8846.c"
1257 #ifdef CONFIG_MFD_WM831X_I2C
1258 #define PMU_POWER_SLEEP RK30_PIN0_PA1
1260 static struct pmu_info wm8326_dcdc_info[] = {
1262 .name = "vdd_core", //logic
1265 .suspend_vol = 950000,
1268 .name = "vdd_cpu", //arm
1271 .suspend_vol = 950000,
1274 .name = "dcdc3", //ddr
1277 .suspend_vol = 1150000,
1279 #ifdef CONFIG_MACH_RK3066_SDK
1281 .name = "dcdc4", //vcc_io
1284 .suspend_vol = 3000000,
1288 .name = "dcdc4", //vcc_io
1291 .suspend_vol = 2800000,
1296 static struct pmu_info wm8326_ldo_info[] = {
1298 .name = "ldo1", //vcc18_cif
1301 .suspend_vol = 1800000,
1304 .name = "ldo2", //vccio_wl
1307 .suspend_vol = 1800000,
1313 .suspend_vol = 1100000,
1316 .name = "ldo4", //vdd11
1319 .suspend_vol = 1000000,
1322 .name = "ldo5", //vcc25
1325 .suspend_vol = 1800000,
1328 .name = "ldo6", //vcc33
1331 .suspend_vol = 3300000,
1334 .name = "ldo7", //vcc28_cif
1337 .suspend_vol = 2800000,
1340 .name = "ldo8", //vcca33
1343 .suspend_vol = 3300000,
1346 .name = "ldo9", //vcc_tp
1349 .suspend_vol = 3300000,
1352 .name = "ldo10", //flash_io
1355 .suspend_vol = 1800000,
1359 #include "board-pmu-wm8326.c"
1362 #ifdef CONFIG_MFD_TPS65910
1363 #ifdef CONFIG_ARCH_RK3066B
1364 #define TPS65910_HOST_IRQ RK30_PIN0_PB3
1366 #define TPS65910_HOST_IRQ RK30_PIN6_PA4
1369 #define PMU_POWER_SLEEP RK30_PIN0_PA1
1371 static struct pmu_info tps65910_dcdc_info[] = {
1373 .name = "vdd_core", //logic
1378 .name = "vdd2", //ddr
1383 .name = "vio", //vcc_io
1389 static struct pmu_info tps65910_ldo_info[] = {
1391 .name = "vpll", //vdd10
1396 .name = "vdig1", //vcc18_cif
1401 .name = "vdig2", //vdd_jetta
1406 .name = "vaux1", //vcc28_cif
1411 .name = "vaux2", //vcca33
1416 .name = "vaux33", //vcc_tp
1421 .name = "vmmc", //vcc30
1426 .name = "vdac", //vcc18
1432 #include "board-pmu-tps65910.c"
1435 static struct i2c_board_info __initdata i2c1_info[] = {
1436 #if defined (CONFIG_REGULATOR_ACT8846)
1441 .irq = ACT8846_HOST_IRQ,
1442 .platform_data=&act8846_data,
1445 #if defined (CONFIG_RTC_HYM8563)
1447 .type = "rtc_hym8563",
1450 .irq = RK30_PIN0_PB5,
1453 #if defined (CONFIG_MFD_WM831X_I2C)
1458 .irq = RK30_PIN0_PB3,
1459 .platform_data = &wm831x_platdata,
1462 #if defined (CONFIG_MFD_TPS65910)
1465 .addr = TPS65910_I2C_ID0,
1467 .irq = TPS65910_HOST_IRQ,
1468 .platform_data = &tps65910_data,
1474 void __sramfunc board_pmu_suspend(void)
1476 #if defined (CONFIG_REGULATOR_ACT8846)
1477 if(pmic_is_act8846())
1478 board_pmu_act8846_suspend();
1480 #if defined (CONFIG_MFD_WM831X_I2C)
1481 if(pmic_is_wm8326())
1482 board_pmu_wm8326_suspend();
1484 #if defined (CONFIG_MFD_TPS65910)
1485 if(pmic_is_tps65910())
1486 board_pmu_tps65910_suspend();
1490 void __sramfunc board_pmu_resume(void)
1492 #if defined (CONFIG_REGULATOR_ACT8846)
1493 if(pmic_is_act8846())
1494 board_pmu_act8846_resume();
1496 #if defined (CONFIG_MFD_WM831X_I2C)
1497 if(pmic_is_wm8326())
1498 board_pmu_wm8326_resume();
1500 #if defined (CONFIG_MFD_TPS65910)
1501 if(pmic_is_tps65910())
1502 board_pmu_tps65910_resume();
1506 int __sramdata gpio3d6_iomux,gpio3d6_do,gpio3d6_dir,gpio3d6_en;
1508 #define grf_readl(offset) readl_relaxed(RK30_GRF_BASE + offset)
1509 #define grf_writel(v, offset) do { writel_relaxed(v, RK30_GRF_BASE + offset); dsb(); } while (0)
1511 void __sramfunc rk30_pwm_logic_suspend_voltage(void)
1513 #ifdef CONFIG_RK30_PWM_REGULATOR
1515 // int gpio0d7_iomux,gpio0d7_do,gpio0d7_dir,gpio0d7_en;
1517 gpio3d6_iomux = grf_readl(GRF_GPIO3D_IOMUX);
1518 gpio3d6_do = grf_readl(GRF_GPIO3H_DO);
1519 gpio3d6_dir = grf_readl(GRF_GPIO3H_DIR);
1520 gpio3d6_en = grf_readl(GRF_GPIO3H_EN);
1522 grf_writel((1<<28), GRF_GPIO3D_IOMUX);
1523 grf_writel((1<<30)|(1<<14), GRF_GPIO3H_DIR);
1524 grf_writel((1<<30)|(1<<14), GRF_GPIO3H_DO);
1525 grf_writel((1<<30)|(1<<14), GRF_GPIO3H_EN);
1528 void __sramfunc rk30_pwm_logic_resume_voltage(void)
1530 #ifdef CONFIG_RK30_PWM_REGULATOR
1531 grf_writel((1<<28)|gpio3d6_iomux, GRF_GPIO3D_IOMUX);
1532 grf_writel((1<<30)|gpio3d6_en, GRF_GPIO3H_EN);
1533 grf_writel((1<<30)|gpio3d6_dir, GRF_GPIO3H_DIR);
1534 grf_writel((1<<30)|gpio3d6_do, GRF_GPIO3H_DO);
1540 extern void pwm_suspend_voltage(void);
1541 extern void pwm_resume_voltage(void);
1542 void rk30_pwm_suspend_voltage_set(void)
1544 #ifdef CONFIG_RK30_PWM_REGULATOR
1545 pwm_suspend_voltage();
1548 void rk30_pwm_resume_voltage_set(void)
1550 #ifdef CONFIG_RK30_PWM_REGULATOR
1551 pwm_resume_voltage();
1556 #ifdef CONFIG_I2C2_RK30
1557 static struct i2c_board_info __initdata i2c2_info[] = {
1558 #if defined (CONFIG_CT36X_TS)
1563 .platform_data = &ct36x_info,
1566 #if defined (CONFIG_LS_CM3217)
1568 .type = "lightsensor",
1571 .platform_data = &cm3217_info,
1577 #ifdef CONFIG_I2C3_RK30
1578 static struct i2c_board_info __initdata i2c3_info[] = {
1582 #ifdef CONFIG_I2C4_RK30
1583 static struct i2c_board_info __initdata i2c4_info[] = {
1584 #ifdef CONFIG_MFD_RK610
1586 .type = "rk610_ctl",
1589 .platform_data = &rk610_ctl_pdata,
1591 #ifdef CONFIG_RK610_TVOUT
1593 .type = "rk610_tvout",
1598 #ifdef CONFIG_HDMI_RK610
1600 .type = "rk610_hdmi",
1603 .irq = INVALID_GPIO,
1606 #ifdef CONFIG_SND_SOC_RK610
1607 {//RK610_CODEC addr from 0x60 to 0x80 (0x60~0x80)
1608 .type = "rk610_i2c_codec",
1611 .platform_data = &rk610_codec_pdata,
1619 #ifdef CONFIG_I2C_GPIO_RK30
1620 #define I2C_SDA_PIN INVALID_GPIO// RK30_PIN2_PD6 //set sda_pin here
1621 #define I2C_SCL_PIN INVALID_GPIO//RK30_PIN2_PD7 //set scl_pin here
1622 static int rk30_i2c_io_init(void)
1624 //set iomux (gpio) here
1625 //rk30_mux_api_set(GPIO2D7_I2C1SCL_NAME, GPIO2D_GPIO2D7);
1626 //rk30_mux_api_set(GPIO2D6_I2C1SDA_NAME, GPIO2D_GPIO2D6);
1630 struct i2c_gpio_platform_data default_i2c_gpio_data = {
1631 .sda_pin = I2C_SDA_PIN,
1632 .scl_pin = I2C_SCL_PIN,
1633 .udelay = 5, // clk = 500/udelay = 100Khz
1634 .timeout = 100,//msecs_to_jiffies(100),
1636 .io_init = rk30_i2c_io_init,
1638 static struct i2c_board_info __initdata i2c_gpio_info[] = {
1642 static void __init rk30_i2c_register_board_info(void)
1644 #ifdef CONFIG_I2C0_RK30
1645 i2c_register_board_info(0, i2c0_info, ARRAY_SIZE(i2c0_info));
1647 #ifdef CONFIG_I2C1_RK30
1648 i2c_register_board_info(1, i2c1_info, ARRAY_SIZE(i2c1_info));
1650 #ifdef CONFIG_I2C2_RK30
1651 i2c_register_board_info(2, i2c2_info, ARRAY_SIZE(i2c2_info));
1653 #ifdef CONFIG_I2C3_RK30
1654 i2c_register_board_info(3, i2c3_info, ARRAY_SIZE(i2c3_info));
1656 #ifdef CONFIG_I2C4_RK30
1657 i2c_register_board_info(4, i2c4_info, ARRAY_SIZE(i2c4_info));
1659 #ifdef CONFIG_I2C_GPIO_RK30
1660 i2c_register_board_info(5, i2c_gpio_info, ARRAY_SIZE(i2c_gpio_info));
1665 #define POWER_ON_PIN RK30_PIN0_PA0 //power_hold
1666 static void rk30_pm_power_off(void)
1668 printk(KERN_ERR "rk30_pm_power_off start...\n");
1669 gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
1670 #if defined(CONFIG_MFD_WM831X)
1671 wm831x_set_bits(Wm831x,WM831X_GPIO_LEVEL,0x0001,0x0000); //set sys_pwr 0
1672 wm831x_device_shutdown(Wm831x);//wm8326 shutdown
1674 #if defined(CONFIG_REGULATOR_ACT8846)
1675 if (pmic_is_act8846()) {
1676 printk("enter dcdet===========\n");
1677 if(gpio_get_value (RK30_PIN0_PB2) == GPIO_LOW)
1679 printk("enter restart===========\n");
1680 arm_pm_restart(0, NULL);
1682 //act8931_device_shutdown();
1688 static void __init machine_rk30_board_init(void)
1691 gpio_request(POWER_ON_PIN, "poweronpin");
1692 gpio_direction_output(POWER_ON_PIN, GPIO_HIGH);
1694 pm_power_off = rk30_pm_power_off;
1696 gpio_direction_output(POWER_ON_PIN, GPIO_HIGH);
1699 rk30_i2c_register_board_info();
1700 spi_register_board_info(board_spi_devices, ARRAY_SIZE(board_spi_devices));
1701 platform_add_devices(devices, ARRAY_SIZE(devices));
1702 rk_platform_add_display_devices();
1703 board_usb_detect_init(RK30_PIN0_PA7);
1705 #ifdef CONFIG_WIFI_CONTROL_FUNC
1706 rk29sdk_wifi_bt_gpio_control_init();
1709 #if defined(CONFIG_MT6620)
1710 clk_set_rate(clk_get_sys("rk_serial.1", "uart"), 48*1000000);
1713 #if defined(CONFIG_MT5931_MT6622)
1714 clk_set_rate(clk_get_sys("rk_serial.0", "uart"), 24*1000000);
1718 static void __init rk30_reserve(void)
1721 rk30_ion_pdata.heaps[0].base = board_mem_reserve_add("ion", ION_RESERVE_SIZE);
1724 #ifdef CONFIG_FB_ROCKCHIP
1725 resource_fb[0].start = board_mem_reserve_add("fb0 buf", get_fb_size());
1726 resource_fb[0].end = resource_fb[0].start + get_fb_size()- 1;
1728 resource_fb[1].start = board_mem_reserve_add("ipp buf", RK30_FB0_MEM_SIZE);
1729 resource_fb[1].end = resource_fb[1].start + RK30_FB0_MEM_SIZE - 1;
1732 #if defined(CONFIG_FB_ROTATE) || !defined(CONFIG_THREE_FB_BUFFER)
1733 resource_fb[2].start = board_mem_reserve_add("fb2 buf",get_fb_size());
1734 resource_fb[2].end = resource_fb[2].start + get_fb_size() - 1;
1739 #ifdef CONFIG_VIDEO_RK29
1740 rk30_camera_request_reserve_mem();
1743 #ifdef CONFIG_GPS_RK
1744 //it must be more than 8MB
1745 rk_gps_info.u32MemoryPhyAddr = board_mem_reserve_add("gps", SZ_8M);
1747 board_mem_reserved();
1751 * dvfs_cpu_logic_table: table for arm and logic dvfs
1752 * @frequency : arm frequency
1753 * @cpu_volt : arm voltage depend on frequency
1754 * @logic_volt : logic voltage arm requests depend on frequency
1755 * comments : min arm/logic voltage
1757 static struct cpufreq_frequency_table dvfs_arm_table[] = {
1758 {.frequency = 312 * 1000, .index = 850 * 1000},
1759 {.frequency = 504 * 1000, .index = 900 * 1000},
1760 {.frequency = 816 * 1000, .index = 950 * 1000},
1761 {.frequency = 1008 * 1000, .index = 1025 * 1000},
1762 {.frequency = 1200 * 1000, .index = 1100 * 1000},
1763 {.frequency = 1416 * 1000, .index = 1200 * 1000},
1764 //{.frequency = 1608 * 1000, .index = 1300 * 1000},
1765 {.frequency = CPUFREQ_TABLE_END},
1768 static struct cpufreq_frequency_table dvfs_gpu_table[] = {
1769 {.frequency = 100 * 1000, .index = 950 * 1000},
1770 {.frequency = 200 * 1000, .index = 975 * 1000},
1771 {.frequency = 266 * 1000, .index = 1000 * 1000},
1772 {.frequency = 300 * 1000, .index = 1050 * 1000},
1773 {.frequency = 400 * 1000, .index = 1100 * 1000},
1774 //{.frequency = 600 * 1000, .index = 1200 * 1000},
1775 {.frequency = CPUFREQ_TABLE_END},
1778 static struct cpufreq_frequency_table dvfs_ddr_table[] = {
1779 {.frequency = 200 * 1000 + DDR_FREQ_SUSPEND, .index = 950 * 1000},
1780 {.frequency = 300 * 1000 + DDR_FREQ_VIDEO, .index = 1000 * 1000},
1781 {.frequency = 400 * 1000 + DDR_FREQ_NORMAL, .index = 1100 * 1000},
1782 {.frequency = CPUFREQ_TABLE_END},
1785 //#define DVFS_CPU_TABLE_SIZE (ARRAY_SIZE(dvfs_cpu_logic_table))
1786 //static struct cpufreq_frequency_table cpu_dvfs_table[DVFS_CPU_TABLE_SIZE];
1787 //static struct cpufreq_frequency_table dep_cpu2core_table[DVFS_CPU_TABLE_SIZE];
1789 void __init board_clock_init(void)
1791 rk30_clock_data_init(periph_pll_default, codec_pll_default, RK30_CLOCKS_DEFAULT_FLAGS);
1792 //dvfs_set_arm_logic_volt(dvfs_cpu_logic_table, cpu_dvfs_table, dep_cpu2core_table);
1793 dvfs_set_freq_volt_table(clk_get(NULL, "cpu"), dvfs_arm_table);
1794 dvfs_set_freq_volt_table(clk_get(NULL, "gpu"), dvfs_gpu_table);
1795 dvfs_set_freq_volt_table(clk_get(NULL, "ddr"), dvfs_ddr_table);
1798 MACHINE_START(RK30, "RK30board")
1799 .boot_params = PLAT_PHYS_OFFSET + 0x800,
1800 .fixup = rk30_fixup,
1801 .reserve = &rk30_reserve,
1802 .map_io = rk30_map_io,
1803 .init_irq = rk30_init_irq,
1804 .timer = &rk30_timer,
1805 .init_machine = machine_rk30_board_init,