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/mfd/rk808.h>
50 #include <linux/mfd/ricoh619.h>
51 #include <linux/regulator/rk29-pwm-regulator.h>
52 #ifdef CONFIG_MFD_RT5025
53 #include <linux/mfd/rt5025.h>
56 #ifdef CONFIG_CW2015_BATTERY
57 #include <linux/power/cw2015_battery.h>
59 #if defined(CONFIG_MFD_RK610)
60 #include <linux/mfd/rk610_core.h>
63 #if defined(CONFIG_MFD_RK616)
64 #include <linux/mfd/rk616.h>
68 #if defined(CONFIG_RK_HDMI)
69 #include "../../../drivers/video/rockchip/hdmi/rk_hdmi.h"
72 #if defined(CONFIG_SPIM_RK29)
73 #include "../../../drivers/spi/rk29_spim.h"
75 #if defined(CONFIG_GPS_RK)
76 #include "../../../drivers/misc/gps/rk_gps/rk_gps.h"
78 #if defined(CONFIG_MU509)
79 #include <linux/mu509.h>
81 #if defined(CONFIG_MW100)
82 #include <linux/mw100.h>
84 #if defined(CONFIG_MT6229)
85 #include <linux/mt6229.h>
87 #if defined(CONFIG_ANDROID_TIMED_GPIO)
88 #include "../../../drivers/staging/android/timed_gpio.h"
91 #if defined(CONFIG_MT6620)
92 #include <linux/gps.h>
94 #include "board-rk3168-tb-camera.c"
96 #if defined(CONFIG_TOUCHSCREEN_GT8XX)
97 #define TOUCH_RESET_PIN RK30_PIN0_PB6
98 #define TOUCH_PWR_PIN RK30_PIN0_PC5 // need to fly line by hardware engineer
100 /* Android Parameter */
101 static int ap_mdm = 0;
102 module_param(ap_mdm, int, 0644);
103 static int ap_has_alsa = 0;
104 module_param(ap_has_alsa, int, 0644);
105 static int ap_data_only = 2;
106 module_param(ap_data_only, int, 0644);
107 static int ap_has_earphone = 0;
108 module_param(ap_has_earphone, int, 0644);
111 static int goodix_init_platform_hw(void)
115 if (TOUCH_PWR_PIN != INVALID_GPIO) {
116 ret = gpio_request(TOUCH_PWR_PIN, "goodix power pin");
118 gpio_free(TOUCH_PWR_PIN);
119 printk("goodix power error\n");
122 gpio_direction_output(TOUCH_PWR_PIN, 0);
123 gpio_set_value(TOUCH_PWR_PIN, GPIO_LOW);
127 if (TOUCH_RESET_PIN != INVALID_GPIO) {
128 ret = gpio_request(TOUCH_RESET_PIN, "goodix reset pin");
130 gpio_free(TOUCH_RESET_PIN);
131 printk("goodix gpio_request error\n");
134 gpio_direction_output(TOUCH_RESET_PIN, 1);
136 //gpio_set_value(TOUCH_RESET_PIN, GPIO_LOW);
138 //gpio_set_value(TOUCH_RESET_PIN, GPIO_HIGH);
144 struct goodix_platform_data goodix_info = {
146 .irq_pin = RK30_PIN1_PB7,
147 .rest_pin = TOUCH_RESET_PIN,
148 .init_platform_hw = goodix_init_platform_hw,
152 static struct spi_board_info board_spi_devices[] = {
155 /***********************************************************
157 ************************************************************/
158 #ifdef CONFIG_BACKLIGHT_RK29_BL
160 #define PWM_MODE PWM3
161 #define PWM_EFFECT_VALUE 1
163 #define LCD_DISP_ON_PIN
165 #ifdef LCD_DISP_ON_PIN
166 #define BL_EN_PIN RK30_PIN0_PA2
167 #define BL_EN_VALUE GPIO_HIGH
169 static int rk29_backlight_io_init(void)
174 #ifdef LCD_DISP_ON_PIN
175 ret = gpio_request(BL_EN_PIN, "bl_en");
177 gpio_direction_output(BL_EN_PIN, BL_EN_VALUE);
183 static int rk29_backlight_io_deinit(void)
185 int ret = 0, pwm_gpio;
186 #ifdef LCD_DISP_ON_PIN
187 gpio_free(BL_EN_PIN);
189 pwm_gpio = iomux_mode_to_gpio(PWM_MODE);
190 gpio_request(pwm_gpio, "bl_pwm");
191 gpio_direction_output(pwm_gpio, GPIO_LOW);
195 static int rk29_backlight_pwm_suspend(void)
197 int ret, pwm_gpio = iomux_mode_to_gpio(PWM_MODE);
199 ret = gpio_request(pwm_gpio, "bl_pwm");
201 printk("func %s, line %d: request gpio fail\n", __FUNCTION__, __LINE__);
204 gpio_direction_output(pwm_gpio, GPIO_LOW);
205 #ifdef LCD_DISP_ON_PIN
206 gpio_direction_output(BL_EN_PIN, !BL_EN_VALUE);
211 static int rk29_backlight_pwm_resume(void)
213 int pwm_gpio = iomux_mode_to_gpio(PWM_MODE);
217 #ifdef LCD_DISP_ON_PIN
219 gpio_direction_output(BL_EN_PIN, BL_EN_VALUE);
224 static struct rk29_bl_info rk29_bl_info = {
228 .brightness_mode =BRIGHTNESS_MODE_CONIC,
229 .bl_ref = PWM_EFFECT_VALUE,
230 .io_init = rk29_backlight_io_init,
231 .io_deinit = rk29_backlight_io_deinit,
232 .pwm_suspend = rk29_backlight_pwm_suspend,
233 .pwm_resume = rk29_backlight_pwm_resume,
236 static struct platform_device rk29_device_backlight = {
237 .name = "rk29_backlight",
240 .platform_data = &rk29_bl_info,
246 #ifdef CONFIG_RK29_SUPPORT_MODEM
248 #define RK30_MODEM_POWER RK30_PIN0_PC6
249 #define RK30_MODEM_POWER_IOMUX iomux_set(GPIO0_C6)
251 static int rk30_modem_io_init(void)
253 printk("%s\n", __FUNCTION__);
254 RK30_MODEM_POWER_IOMUX;
259 static struct rk29_io_t rk30_modem_io = {
260 .io_addr = RK30_MODEM_POWER,
263 .io_init = rk30_modem_io_init,
266 static struct platform_device rk30_device_modem = {
267 .name = "rk30_modem",
270 .platform_data = &rk30_modem_io,
274 #if defined(CONFIG_MU509)
275 static int mu509_io_init(void)
286 static int mu509_io_deinit(void)
292 struct rk29_mu509_data rk29_mu509_info = {
293 .io_init = mu509_io_init,
294 .io_deinit = mu509_io_deinit,
295 .modem_power_en = RK30_PIN2_PD5,
296 .bp_power = RK30_PIN0_PC6,
297 .bp_reset = RK30_PIN2_PD4,
298 .ap_wakeup_bp = RK30_PIN0_PC4,
299 .bp_wakeup_ap = RK30_PIN0_PC5,
301 struct platform_device rk29_device_mu509 = {
305 .platform_data = &rk29_mu509_info,
309 #if defined(CONFIG_MW100)
310 static int mw100_io_init(void)
320 static int mw100_io_deinit(void)
326 struct rk29_mw100_data rk29_mw100_info = {
327 .io_init = mw100_io_init,
328 .io_deinit = mw100_io_deinit,
329 .modem_power_en = RK30_PIN2_PD5,
330 .bp_power = RK30_PIN0_PC6,
331 .bp_reset = RK30_PIN2_PD4,
332 .ap_wakeup_bp = RK30_PIN0_PC4,
333 .bp_wakeup_ap = RK30_PIN0_PC5,
335 struct platform_device rk29_device_mw100 = {
339 .platform_data = &rk29_mw100_info,
343 #if defined(CONFIG_MT6229)
344 static int mt6229_io_init(void)
354 static int mt6229_io_deinit(void)
360 struct rk29_mt6229_data rk29_mt6229_info = {
361 .io_init = mt6229_io_init,
362 .io_deinit = mt6229_io_deinit,
363 .modem_power_en = RK30_PIN2_PD5,
364 .bp_power = RK30_PIN0_PC6,
365 .bp_reset = RK30_PIN2_PD4,
366 .ap_wakeup_bp = RK30_PIN0_PC4,
367 .bp_wakeup_ap = RK30_PIN0_PC5,
369 struct platform_device rk29_device_mt6229 = {
373 .platform_data = &rk29_mt6229_info,
379 #if defined (CONFIG_GS_MMA8452)
380 #define MMA8452_INT_PIN RK30_PIN0_PB7
382 static int mma8452_init_platform_hw(void)
387 static struct sensor_platform_data mma8452_info = {
388 .type = SENSOR_TYPE_ACCEL,
391 .init_platform_hw = mma8452_init_platform_hw,
392 .orientation = {-1, 0, 0, 0, -1, 0, 0, 0, 1},
395 #if defined (CONFIG_GS_LIS3DH)
396 #define LIS3DH_INT_PIN RK30_PIN0_PB7
398 static int lis3dh_init_platform_hw(void)
404 static struct sensor_platform_data lis3dh_info = {
405 .type = SENSOR_TYPE_ACCEL,
408 .init_platform_hw = lis3dh_init_platform_hw,
409 .orientation = {-1, 0, 0, 0, -1, 0, 0, 0, 1},
412 #if defined (CONFIG_COMPASS_AK8975)
413 static struct sensor_platform_data akm8975_info =
415 .type = SENSOR_TYPE_COMPASS,
448 #if defined(CONFIG_GYRO_L3G4200D)
450 #include <linux/l3g4200d.h>
451 #define L3G4200D_INT_PIN RK30_PIN0_PB4
453 static int l3g4200d_init_platform_hw(void)
458 static struct sensor_platform_data l3g4200d_info = {
459 .type = SENSOR_TYPE_GYROSCOPE,
462 .orientation = {0, 1, 0, -1, 0, 0, 0, 0, 1},
463 .init_platform_hw = l3g4200d_init_platform_hw,
464 .x_min = 40,//x_min,y_min,z_min = (0-100) according to hardware
471 #ifdef CONFIG_LS_CM3217
472 static struct sensor_platform_data cm3217_info = {
473 .type = SENSOR_TYPE_LIGHT,
475 .poll_delay_ms = 500,
480 #ifdef CONFIG_FB_ROCKCHIP
482 #define LCD_CS_PIN INVALID_GPIO
483 #define LCD_CS_VALUE GPIO_HIGH
485 #define LCD_EN_PIN RK30_PIN0_PB0
486 #define LCD_EN_VALUE GPIO_HIGH
488 static int rk_fb_io_init(struct rk29_fb_setting_info *fb_setting)
492 if(LCD_CS_PIN !=INVALID_GPIO)
494 ret = gpio_request(LCD_CS_PIN, NULL);
497 gpio_free(LCD_CS_PIN);
498 printk(KERN_ERR "request lcd cs pin fail!\n");
503 gpio_direction_output(LCD_CS_PIN, LCD_CS_VALUE);
507 if(LCD_EN_PIN !=INVALID_GPIO)
509 ret = gpio_request(LCD_EN_PIN, NULL);
512 gpio_free(LCD_EN_PIN);
513 printk(KERN_ERR "request lcd en pin fail!\n");
518 gpio_direction_output(LCD_EN_PIN, LCD_EN_VALUE);
523 static int rk_fb_io_disable(void)
525 if(LCD_CS_PIN !=INVALID_GPIO)
527 gpio_set_value(LCD_CS_PIN, !LCD_CS_VALUE);
529 if(LCD_EN_PIN !=INVALID_GPIO)
531 gpio_set_value(LCD_EN_PIN, !LCD_EN_VALUE);
535 static int rk_fb_io_enable(void)
537 if(LCD_CS_PIN !=INVALID_GPIO)
539 gpio_set_value(LCD_CS_PIN, LCD_CS_VALUE);
541 if(LCD_EN_PIN !=INVALID_GPIO)
543 gpio_set_value(LCD_EN_PIN, LCD_EN_VALUE);
548 #if defined(CONFIG_LCDC0_RK3066B) || defined(CONFIG_LCDC0_RK3188)
549 struct rk29fb_info lcdc0_screen_info = {
550 #if defined(CONFIG_RK_HDMI) && defined(CONFIG_HDMI_SOURCE_LCDC0) && defined(CONFIG_DUAL_LCDC_DUAL_DISP_IN_KERNEL)
551 .prop = EXTEND, //extend display device
555 .set_screen_info = hdmi_init_lcdc,
557 .prop = PRMRY, //primary display device
558 .io_init = rk_fb_io_init,
559 .io_disable = rk_fb_io_disable,
560 .io_enable = rk_fb_io_enable,
561 .set_screen_info = set_lcd_info,
566 #if defined(CONFIG_LCDC1_RK3066B) || defined(CONFIG_LCDC1_RK3188)
567 struct rk29fb_info lcdc1_screen_info = {
568 #if defined(CONFIG_RK_HDMI) && defined(CONFIG_HDMI_SOURCE_LCDC1) && defined(CONFIG_DUAL_LCDC_DUAL_DISP_IN_KERNEL)
569 .prop = EXTEND, //extend display device
573 .set_screen_info = hdmi_init_lcdc,
575 .prop = PRMRY, //primary display device
576 .io_init = rk_fb_io_init,
577 .io_disable = rk_fb_io_disable,
578 .io_enable = rk_fb_io_enable,
579 .set_screen_info = set_lcd_info,
584 static struct resource resource_fb[] = {
588 .end = 0,//RK30_FB0_MEM_SIZE - 1,
589 .flags = IORESOURCE_MEM,
592 .name = "ipp buf", //for rotate
594 .end = 0,//RK30_FB0_MEM_SIZE - 1,
595 .flags = IORESOURCE_MEM,
600 .end = 0,//RK30_FB0_MEM_SIZE - 1,
601 .flags = IORESOURCE_MEM,
605 static struct platform_device device_fb = {
608 .num_resources = ARRAY_SIZE(resource_fb),
609 .resource = resource_fb,
612 #if defined(CONFIG_ARCH_RK3188)
613 static struct resource resource_mali[] = {
618 .flags = IORESOURCE_MEM,
623 static struct platform_device device_mali= {
624 .name = "mali400_ump",
626 .num_resources = ARRAY_SIZE(resource_mali),
627 .resource = resource_mali,
631 #if defined(CONFIG_LCDC0_RK3066B) || defined(CONFIG_LCDC0_RK3188)
632 static struct resource resource_lcdc0[] = {
635 .start = RK30_LCDC0_PHYS,
636 .end = RK30_LCDC0_PHYS + RK30_LCDC0_SIZE - 1,
637 .flags = IORESOURCE_MEM,
644 .flags = IORESOURCE_IRQ,
648 static struct platform_device device_lcdc0 = {
651 .num_resources = ARRAY_SIZE(resource_lcdc0),
652 .resource = resource_lcdc0,
654 .platform_data = &lcdc0_screen_info,
658 #if defined(CONFIG_LCDC1_RK3066B) || defined(CONFIG_LCDC1_RK3188)
659 static struct resource resource_lcdc1[] = {
662 .start = RK30_LCDC1_PHYS,
663 .end = RK30_LCDC1_PHYS + RK30_LCDC1_SIZE - 1,
664 .flags = IORESOURCE_MEM,
670 .flags = IORESOURCE_IRQ,
674 static struct platform_device device_lcdc1 = {
677 .num_resources = ARRAY_SIZE(resource_lcdc1),
678 .resource = resource_lcdc1,
680 .platform_data = &lcdc1_screen_info,
685 #if defined(CONFIG_MFD_RK610)
686 #define RK610_RST_PIN RK30_PIN2_PC5
687 static int rk610_power_on_init(void)
690 if(RK610_RST_PIN != INVALID_GPIO)
692 ret = gpio_request(RK610_RST_PIN, "rk610 reset");
695 printk(KERN_ERR "rk610_control_probe request gpio fail\n");
699 gpio_direction_output(RK610_RST_PIN, GPIO_HIGH);
701 gpio_direction_output(RK610_RST_PIN, GPIO_LOW);
703 gpio_set_value(RK610_RST_PIN, GPIO_HIGH);
712 static struct rk610_ctl_platform_data rk610_ctl_pdata = {
713 .rk610_power_on_init = rk610_power_on_init,
717 #if defined(CONFIG_MFD_RK616)
718 #define RK616_RST_PIN RK30_PIN3_PB2
719 #define RK616_PWREN_PIN RK30_PIN0_PA3
720 #define RK616_SCL_RATE (100*1000) //i2c scl rate
721 static int rk616_power_on_init(void)
725 if(RK616_PWREN_PIN != INVALID_GPIO)
727 ret = gpio_request(RK616_PWREN_PIN, "rk616 pwren");
730 printk(KERN_ERR "rk616 pwren gpio request fail\n");
734 gpio_direction_output(RK616_PWREN_PIN,GPIO_HIGH);
738 if(RK616_RST_PIN != INVALID_GPIO)
740 ret = gpio_request(RK616_RST_PIN, "rk616 reset");
743 printk(KERN_ERR "rk616 reset gpio request fail\n");
747 gpio_direction_output(RK616_RST_PIN, GPIO_HIGH);
749 gpio_direction_output(RK616_RST_PIN, GPIO_LOW);
751 gpio_set_value(RK616_RST_PIN, GPIO_HIGH);
760 static int rk616_power_deinit(void)
762 gpio_set_value(RK616_PWREN_PIN,GPIO_LOW);
763 gpio_set_value(RK616_RST_PIN,GPIO_LOW);
764 gpio_free(RK616_PWREN_PIN);
765 gpio_free(RK616_RST_PIN);
770 static struct rk616_platform_data rk616_pdata = {
771 .power_init = rk616_power_on_init,
772 .power_deinit = rk616_power_deinit,
773 .scl_rate = RK616_SCL_RATE,
774 .lcd0_func = INPUT, //port lcd0 as input
775 .lcd1_func = INPUT, //port lcd1 as input
776 .lvds_ch_nr = 1, //the number of used lvds channel
777 .hdmi_irq = RK30_PIN2_PD6,
778 .spk_ctl_gpio = RK30_PIN2_PD7,
779 .hp_ctl_gpio = RK30_PIN2_PD7,
784 #ifdef CONFIG_SND_SOC_RK610
785 static int rk610_codec_io_init(void)
788 //Must not gpio_request
792 static struct rk610_codec_platform_data rk610_codec_pdata = {
793 .spk_ctl_io = RK30_PIN2_PD7,
794 .io_init = rk610_codec_io_init,
798 #ifdef CONFIG_ANDROID_TIMED_GPIO
799 static struct timed_gpio timed_gpios[] = {
802 .gpio = INVALID_GPIO,
805 .adjust_time =20, //adjust for diff product
809 static struct timed_gpio_platform_data rk29_vibrator_info = {
811 .gpios = timed_gpios,
814 static struct platform_device rk29_device_vibrator = {
815 .name = "timed-gpio",
818 .platform_data = &rk29_vibrator_info,
824 #ifdef CONFIG_LEDS_GPIO_PLATFORM
825 static struct gpio_led rk29_leds[] = {
827 .name = "button-backlight",
828 .gpio = INVALID_GPIO,
829 .default_trigger = "timer",
831 .retain_state_suspended = 0,
832 .default_state = LEDS_GPIO_DEFSTATE_OFF,
836 static struct gpio_led_platform_data rk29_leds_pdata = {
838 .num_leds = ARRAY_SIZE(rk29_leds),
841 static struct platform_device rk29_device_gpio_leds = {
845 .platform_data = &rk29_leds_pdata,
850 #ifdef CONFIG_RK_IRDA
851 #define IRDA_IRQ_PIN INVALID_GPIO //RK30_PIN0_PA3
853 static int irda_iomux_init(void)
858 ret = gpio_request(IRDA_IRQ_PIN, NULL);
860 gpio_free(IRDA_IRQ_PIN);
861 printk(">>>>>> IRDA_IRQ_PIN gpio_request err \n ");
863 gpio_pull_updown(IRDA_IRQ_PIN, PullDisable);
864 gpio_direction_input(IRDA_IRQ_PIN);
869 static int irda_iomux_deinit(void)
871 gpio_free(IRDA_IRQ_PIN);
875 static struct irda_info rk29_irda_info = {
876 .intr_pin = IRDA_IRQ_PIN,
877 .iomux_init = irda_iomux_init,
878 .iomux_deinit = irda_iomux_deinit,
879 //.irda_pwr_ctl = bu92747guw_power_ctl,
882 static struct platform_device irda_device = {
883 #ifdef CONFIG_RK_IRDA_NET
886 .name = "bu92747_irda",
890 .platform_data = &rk29_irda_info,
896 #define ION_RESERVE_SIZE (80 * SZ_1M)
897 static struct ion_platform_data rk30_ion_pdata = {
901 .type = ION_HEAP_TYPE_CARVEOUT,
902 .id = ION_NOR_HEAP_ID,
904 .size = ION_RESERVE_SIZE,
909 static struct platform_device device_ion = {
910 .name = "ion-rockchip",
913 .platform_data = &rk30_ion_pdata,
918 /**************************************************************************************************
919 * SDMMC devices, include the module of SD,MMC,and sdio.noted by xbw at 2012-03-05
920 **************************************************************************************************/
921 #ifdef CONFIG_SDMMC_RK29
922 #include "board-rk3168-tb-sdmmc-conifg.c"
923 #include "../plat-rk/rk-sdmmc-ops.c"
924 #include "../plat-rk/rk-sdmmc-wifi.c"
925 #endif //endif ---#ifdef CONFIG_SDMMC_RK29
927 #ifdef CONFIG_SDMMC0_RK29
928 static int rk29_sdmmc0_cfg_gpio(void)
930 #ifdef CONFIG_SDMMC_RK29_OLD
932 iomux_set(MMC0_CLKOUT);
938 iomux_set_gpio_mode(iomux_mode_to_gpio(MMC0_DETN));
940 gpio_request(RK30_PIN3_PA7, "sdmmc-power");
941 gpio_direction_output(RK30_PIN3_PA7, GPIO_LOW);
944 rk29_sdmmc_set_iomux(0, 0xFFFF);
946 #if defined(CONFIG_SDMMC0_RK29_SDCARD_DET_FROM_GPIO)
947 #if SDMMC_USE_NEW_IOMUX_API
948 iomux_set_gpio_mode(iomux_gpio_to_mode(RK29SDK_SD_CARD_DETECT_N));
950 rk30_mux_api_set(RK29SDK_SD_CARD_DETECT_PIN_NAME, RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO);
953 #if SDMMC_USE_NEW_IOMUX_API
954 iomux_set(MMC0_DETN);
956 rk30_mux_api_set(RK29SDK_SD_CARD_DETECT_PIN_NAME, RK29SDK_SD_CARD_DETECT_IOMUX_FMUX);
960 #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
961 gpio_request(SDMMC0_WRITE_PROTECT_PIN, "sdmmc-wp");
962 gpio_direction_input(SDMMC0_WRITE_PROTECT_PIN);
970 #define CONFIG_SDMMC0_USE_DMA
971 struct rk29_sdmmc_platform_data default_sdmmc0_data = {
973 (MMC_VDD_25_26 | MMC_VDD_26_27 | MMC_VDD_27_28 | MMC_VDD_28_29 |
974 MMC_VDD_29_30 | MMC_VDD_30_31 | MMC_VDD_31_32 | MMC_VDD_32_33 |
975 MMC_VDD_33_34 | MMC_VDD_34_35 | MMC_VDD_35_36),
977 (MMC_CAP_4_BIT_DATA | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
978 .io_init = rk29_sdmmc0_cfg_gpio,
980 #if !defined(CONFIG_SDMMC_RK29_OLD)
981 .set_iomux = rk29_sdmmc_set_iomux,
984 .dma_name = "sd_mmc",
985 #ifdef CONFIG_SDMMC0_USE_DMA
991 #if defined(CONFIG_WIFI_COMBO_MODULE_CONTROL_FUNC) && defined(CONFIG_USE_SDMMC0_FOR_WIFI_DEVELOP_BOARD)
992 .status = rk29sdk_wifi_mmc0_status,
993 .register_status_notify = rk29sdk_wifi_mmc0_status_register,
996 #if defined(RK29SDK_SD_CARD_PWR_EN) || (INVALID_GPIO != RK29SDK_SD_CARD_PWR_EN)
997 .power_en = RK29SDK_SD_CARD_PWR_EN,
998 .power_en_level = RK29SDK_SD_CARD_PWR_EN_LEVEL,
1000 .power_en = INVALID_GPIO,
1001 .power_en_level = GPIO_LOW,
1003 .enable_sd_wakeup = 0,
1005 #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
1006 .write_prt = SDMMC0_WRITE_PROTECT_PIN,
1007 .write_prt_enalbe_level = SDMMC0_WRITE_PROTECT_ENABLE_VALUE;
1009 .write_prt = INVALID_GPIO,
1013 #if defined(RK29SDK_SD_CARD_DETECT_N) || (INVALID_GPIO != RK29SDK_SD_CARD_DETECT_N)
1014 .io = RK29SDK_SD_CARD_DETECT_N, //INVALID_GPIO,
1015 .enable = RK29SDK_SD_CARD_INSERT_LEVEL,
1016 #ifdef RK29SDK_SD_CARD_DETECT_PIN_NAME
1018 .name = RK29SDK_SD_CARD_DETECT_PIN_NAME,
1019 #ifdef RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO
1020 .fgpio = RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO,
1022 #ifdef RK29SDK_SD_CARD_DETECT_IOMUX_FMUX
1023 .fmux = RK29SDK_SD_CARD_DETECT_IOMUX_FMUX,
1034 #endif // CONFIG_SDMMC0_RK29
1036 #ifdef CONFIG_SDMMC1_RK29
1037 #define CONFIG_SDMMC1_USE_DMA
1038 static int rk29_sdmmc1_cfg_gpio(void)
1040 #if defined(CONFIG_SDMMC_RK29_OLD)
1041 iomux_set(MMC1_CMD);
1042 iomux_set(MMC1_CLKOUT);
1049 #if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
1050 gpio_request(SDMMC1_WRITE_PROTECT_PIN, "sdio-wp");
1051 gpio_direction_input(SDMMC1_WRITE_PROTECT_PIN);
1059 struct rk29_sdmmc_platform_data default_sdmmc1_data = {
1061 (MMC_VDD_25_26 | MMC_VDD_26_27 | MMC_VDD_27_28 | MMC_VDD_28_29 |
1062 MMC_VDD_29_30 | MMC_VDD_30_31 | MMC_VDD_31_32 | MMC_VDD_32_33 |
1065 #if !defined(CONFIG_USE_SDMMC1_FOR_WIFI_DEVELOP_BOARD)
1066 .host_caps = (MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ |
1067 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
1070 (MMC_CAP_4_BIT_DATA | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
1073 .io_init = rk29_sdmmc1_cfg_gpio,
1075 #if !defined(CONFIG_SDMMC_RK29_OLD)
1076 .set_iomux = rk29_sdmmc_set_iomux,
1080 #ifdef CONFIG_SDMMC1_USE_DMA
1086 #if defined(CONFIG_WIFI_CONTROL_FUNC) || defined(CONFIG_WIFI_COMBO_MODULE_CONTROL_FUNC)
1087 .status = rk29sdk_wifi_status,
1088 .register_status_notify = rk29sdk_wifi_status_register,
1091 #if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
1092 .write_prt = SDMMC1_WRITE_PROTECT_PIN,
1093 .write_prt_enalbe_level = SDMMC1_WRITE_PROTECT_ENABLE_VALUE;
1095 .write_prt = INVALID_GPIO,
1098 #if defined(CONFIG_RK29_SDIO_IRQ_FROM_GPIO)
1099 .sdio_INT_gpio = RK29SDK_WIFI_SDIO_CARD_INT,
1103 #if defined(CONFIG_USE_SDMMC1_FOR_WIFI_DEVELOP_BOARD)
1104 #if defined(RK29SDK_SD_CARD_DETECT_N) || (INVALID_GPIO != RK29SDK_SD_CARD_DETECT_N)
1105 .io = RK29SDK_SD_CARD_DETECT_N,
1110 .enable = RK29SDK_SD_CARD_INSERT_LEVEL,
1111 #ifdef RK29SDK_SD_CARD_DETECT_PIN_NAME
1113 .name = RK29SDK_SD_CARD_DETECT_PIN_NAME,
1114 #ifdef RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO
1115 .fgpio = RK29SDK_SD_CARD_DETECT_IOMUX_FGPIO,
1117 #ifdef RK29SDK_SD_CARD_DETECT_IOMUX_FMUX
1118 .fmux = RK29SDK_SD_CARD_DETECT_IOMUX_FMUX,
1128 .enable_sd_wakeup = 0,
1130 #endif //endif--#ifdef CONFIG_SDMMC1_RK29
1132 /**************************************************************************************************
1133 * the end of setting for SDMMC devices
1134 **************************************************************************************************/
1136 #ifdef CONFIG_BATTERY_RK30_ADC
1137 static struct rk30_adc_battery_platform_data rk30_adc_battery_platdata = {
1138 .dc_det_pin = RK30_PIN0_PB2,
1139 .batt_low_pin = RK30_PIN0_PB1,
1140 .charge_set_pin = INVALID_GPIO,
1141 .charge_ok_pin = RK30_PIN0_PA6,
1142 .dc_det_level = GPIO_LOW,
1143 .charge_ok_level = GPIO_HIGH,
1146 static struct platform_device rk30_device_adc_battery = {
1147 .name = "rk30-battery",
1150 .platform_data = &rk30_adc_battery_platdata,
1154 #ifdef CONFIG_CW2015_BATTERY
1156 note the follow array must set depend on the battery that you use
1157 you must send the battery to cellwise-semi the contact information:
1158 name: chen gan; tel:13416876079; E-mail: ben.chen@cellwise-semi.com
1160 static u8 config_info[SIZE_BATINFO] = {
1161 0x15, 0x42, 0x60, 0x59, 0x52,
1162 0x58, 0x4D, 0x48, 0x48, 0x44,
1163 0x44, 0x46, 0x49, 0x48, 0x32,
1164 0x24, 0x20, 0x17, 0x13, 0x0F,
1165 0x19, 0x3E, 0x51, 0x45, 0x08,
1166 0x76, 0x0B, 0x85, 0x0E, 0x1C,
1167 0x2E, 0x3E, 0x4D, 0x52, 0x52,
1168 0x57, 0x3D, 0x1B, 0x6A, 0x2D,
1169 0x25, 0x43, 0x52, 0x87, 0x8F,
1170 0x91, 0x94, 0x52, 0x82, 0x8C,
1171 0x92, 0x96, 0xFF, 0x7B, 0xBB,
1172 0xCB, 0x2F, 0x7D, 0x72, 0xA5,
1173 0xB5, 0xC1, 0x46, 0xAE
1176 static struct cw_bat_platform_data cw_bat_platdata = {
1177 .dc_det_pin = RK30_PIN0_PB2,
1178 .dc_det_level = GPIO_LOW,
1180 .bat_low_pin = RK30_PIN0_PB1,
1181 .bat_low_level = GPIO_LOW,
1182 .chg_ok_pin = INVALID_GPIO,
1183 .chg_ok_level = GPIO_HIGH,
1186 .chg_mode_sel_pin = INVALID_GPIO,
1187 .chg_mode_sel_level = GPIO_HIGH,
1189 .cw_bat_config_info = config_info,
1194 #ifdef CONFIG_RK30_PWM_REGULATOR
1195 static int pwm_voltage_map[] = {
1196 800000,825000,850000, 875000,900000, 925000 ,950000, 975000,1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000,1375000
1198 static struct regulator_consumer_supply pwm_dcdc1_consumers[] = {
1200 .supply = "vdd_cpu",
1204 struct regulator_init_data pwm_regulator_init_dcdc[1] =
1208 .name = "PWM_DCDC1",
1210 .max_uV = 1800000, //0.6-1.8V
1212 .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE,
1214 .num_consumer_supplies = ARRAY_SIZE(pwm_dcdc1_consumers),
1215 .consumer_supplies = pwm_dcdc1_consumers,
1219 static struct pwm_platform_data pwm_regulator_info[1] = {
1222 .pwm_gpio = RK30_PIN3_PD4,
1223 .pwm_iomux_pwm = PWM1,
1224 .pwm_iomux_gpio = GPIO3_D4,
1225 .pwm_voltage = 1100000,
1226 .suspend_voltage = 1000000,
1229 .coefficient = 575, //57.5%
1230 .pwm_voltage_map = pwm_voltage_map,
1231 .init_data = &pwm_regulator_init_dcdc[0],
1235 struct platform_device pwm_regulator_device[1] = {
1237 .name = "pwm-voltage-regulator",
1240 .platform_data = &pwm_regulator_info[0],
1246 #ifdef CONFIG_RK29_VMAC
1247 #define PHY_PWR_EN_GPIO RK30_PIN1_PD6
1248 #include "board-rk30-sdk-vmac.c"
1251 #ifdef CONFIG_RFKILL_RK
1252 // bluetooth rfkill device, its driver in net/rfkill/rfkill-rk.c
1253 static struct rfkill_rk_platform_data rfkill_rk_platdata = {
1254 .type = RFKILL_TYPE_BLUETOOTH,
1256 .poweron_gpio = { // BT_REG_ON
1257 .io = INVALID_GPIO, //RK30_PIN3_PC7,
1258 .enable = GPIO_HIGH,
1260 .name = "bt_poweron",
1265 .reset_gpio = { // BT_RST
1266 .io = RK30_PIN3_PC7, // set io to INVALID_GPIO for disable it
1274 .wake_gpio = { // BT_WAKE, use to control bt's sleep and wakeup
1275 .io = RK30_PIN3_PC6, // set io to INVALID_GPIO for disable it
1276 .enable = GPIO_HIGH,
1283 .wake_host_irq = { // BT_HOST_WAKE, for bt wakeup host when it is in deep sleep
1285 .io = RK30_PIN0_PA5, // set io to INVALID_GPIO for disable it
1286 .enable = GPIO_LOW, // set GPIO_LOW for falling, set 0 for rising
1293 .rts_gpio = { // UART_RTS, enable or disable BT's data coming
1294 .io = RK30_PIN1_PA3, // set io to INVALID_GPIO for disable it
1304 static struct platform_device device_rfkill_rk = {
1305 .name = "rfkill_rk",
1308 .platform_data = &rfkill_rk_platdata,
1313 #if defined(CONFIG_GPS_RK)
1314 int rk_gps_io_init(void)
1316 printk("%s \n", __FUNCTION__);
1318 gpio_request(RK30_PIN1_PB5, NULL);
1319 gpio_direction_output(RK30_PIN1_PB5, GPIO_LOW);
1321 iomux_set(GPS_RFCLK);//GPS_CLK
1322 iomux_set(GPS_MAG);//GPS_MAG
1323 iomux_set(GPS_SIG);//GPS_SIGN
1325 gpio_request(RK30_PIN1_PA6, NULL);
1326 gpio_direction_output(RK30_PIN1_PA6, GPIO_LOW);
1328 gpio_request(RK30_PIN1_PA5, NULL);
1329 gpio_direction_output(RK30_PIN1_PA5, GPIO_LOW);
1331 gpio_request(RK30_PIN1_PA7, NULL);
1332 gpio_direction_output(RK30_PIN1_PA7, GPIO_LOW);
1335 int rk_gps_power_up(void)
1337 printk("%s \n", __FUNCTION__);
1342 int rk_gps_power_down(void)
1344 printk("%s \n", __FUNCTION__);
1349 int rk_gps_reset_set(int level)
1353 int rk_enable_hclk_gps(void)
1355 struct clk *gps_aclk = NULL;
1356 gps_aclk = clk_get(NULL, "aclk_gps");
1358 clk_enable(gps_aclk);
1360 printk("%s \n", __FUNCTION__);
1363 printk("get gps aclk fail\n");
1366 int rk_disable_hclk_gps(void)
1368 struct clk *gps_aclk = NULL;
1369 gps_aclk = clk_get(NULL, "aclk_gps");
1371 //TO wait long enough until GPS ISR is finished.
1373 clk_disable(gps_aclk);
1375 printk("%s \n", __FUNCTION__);
1378 printk("get gps aclk fail\n");
1381 struct rk_gps_data rk_gps_info = {
1382 .io_init = rk_gps_io_init,
1383 .power_up = rk_gps_power_up,
1384 .power_down = rk_gps_power_down,
1385 .reset = rk_gps_reset_set,
1386 .enable_hclk_gps = rk_enable_hclk_gps,
1387 .disable_hclk_gps = rk_disable_hclk_gps,
1388 .GpsSign = RK30_PIN1_PB3,
1389 .GpsMag = RK30_PIN1_PB2, //GPIO index
1390 .GpsClk = RK30_PIN1_PB4, //GPIO index
1391 .GpsVCCEn = RK30_PIN1_PB5, //GPIO index
1392 .GpsSpi_CSO = RK30_PIN1_PA4, //GPIO index
1393 .GpsSpiClk = RK30_PIN1_PA5, //GPIO index
1394 .GpsSpiMOSI = RK30_PIN1_PA7, //GPIO index
1398 .u32GpsPhyAddr = RK30_GPS_PHYS,
1399 .u32GpsPhySize = RK30_GPS_SIZE,
1402 struct platform_device rk_device_gps = {
1403 .name = "gps_hv5820b",
1406 .platform_data = &rk_gps_info,
1411 #if defined(CONFIG_MT5931_MT6622)
1412 static struct mt6622_platform_data mt6622_platdata = {
1413 .power_gpio = { // BT_REG_ON
1414 .io = RK30_PIN3_PD5, // set io to INVALID_GPIO for disable it
1415 .enable = GPIO_HIGH,
1421 .reset_gpio = { // BT_RST
1422 .io = RK30_PIN0_PD7,
1423 .enable = GPIO_HIGH,
1430 .io = RK30_PIN3_PD2,
1431 .enable = GPIO_HIGH,
1437 .rts_gpio = { // UART_RTS
1438 .io = RK30_PIN1_PA3,
1448 static struct platform_device device_mt6622 = {
1452 .platform_data = &mt6622_platdata,
1457 static struct platform_device *devices[] __initdata = {
1461 #ifdef CONFIG_ANDROID_TIMED_GPIO
1462 &rk29_device_vibrator,
1464 #ifdef CONFIG_LEDS_GPIO_PLATFORM
1465 &rk29_device_gpio_leds,
1467 #ifdef CONFIG_RK_IRDA
1470 #if defined(CONFIG_WIFI_CONTROL_FUNC)||defined(CONFIG_WIFI_COMBO_MODULE_CONTROL_FUNC)
1471 &rk29sdk_wifi_device,
1474 #if defined(CONFIG_MT6620)
1478 #ifdef CONFIG_RK29_SUPPORT_MODEM
1481 #if defined(CONFIG_MU509)
1484 #if defined(CONFIG_MW100)
1487 #if defined(CONFIG_MT6229)
1488 &rk29_device_mt6229,
1490 #ifdef CONFIG_BATTERY_RK30_ADC
1491 &rk30_device_adc_battery,
1493 #ifdef CONFIG_RFKILL_RK
1496 #ifdef CONFIG_GPS_RK
1499 #if defined(CONFIG_ARCH_RK3188)
1502 #ifdef CONFIG_MT5931_MT6622
1507 static int rk_platform_add_display_devices(void)
1509 struct platform_device *fb = NULL; //fb
1510 struct platform_device *lcdc0 = NULL; //lcdc0
1511 struct platform_device *lcdc1 = NULL; //lcdc1
1512 struct platform_device *bl = NULL; //backlight
1513 #ifdef CONFIG_FB_ROCKCHIP
1517 #if defined(CONFIG_LCDC0_RK3066B) || defined(CONFIG_LCDC0_RK3188)
1518 lcdc0 = &device_lcdc0,
1521 #if defined(CONFIG_LCDC1_RK3066B) || defined(CONFIG_LCDC1_RK3188)
1522 lcdc1 = &device_lcdc1,
1525 #ifdef CONFIG_BACKLIGHT_RK29_BL
1526 bl = &rk29_device_backlight,
1528 __rk_platform_add_display_devices(fb,lcdc0,lcdc1,bl);
1535 #ifdef CONFIG_I2C0_RK30
1536 static struct i2c_board_info __initdata i2c0_info[] = {
1537 #if defined (CONFIG_GS_MMA8452)
1539 .type = "gs_mma8452",
1542 .irq = MMA8452_INT_PIN,
1543 .platform_data = &mma8452_info,
1546 #if defined (CONFIG_GS_LIS3DH)
1548 .type = "gs_lis3dh",
1549 .addr = 0x19, //0x19(SA0-->VCC), 0x18(SA0-->GND)
1551 .irq = LIS3DH_INT_PIN,
1552 .platform_data = &lis3dh_info,
1555 #if defined (CONFIG_COMPASS_AK8975)
1560 .irq = RK30_PIN3_PD7,
1561 .platform_data = &akm8975_info,
1564 #if defined (CONFIG_GYRO_L3G4200D)
1566 .type = "l3g4200d_gryo",
1569 .irq = L3G4200D_INT_PIN,
1570 .platform_data = &l3g4200d_info,
1573 #if defined (CONFIG_SND_SOC_RK1000)
1575 .type = "rk1000_i2c_codec",
1580 .type = "rk1000_control",
1585 #if defined (CONFIG_SND_SOC_RT5631)
1593 #if defined (CONFIG_SND_SOC_RT5640)
1601 #ifdef CONFIG_MFD_RK610
1603 .type = "rk610_ctl",
1606 .platform_data = &rk610_ctl_pdata,
1608 #ifdef CONFIG_RK610_TVOUT
1610 .type = "rk610_tvout",
1615 #ifdef CONFIG_HDMI_RK610
1617 .type = "rk610_hdmi",
1620 .irq = INVALID_GPIO,
1623 #ifdef CONFIG_SND_SOC_RK610
1624 {//RK610_CODEC addr from 0x60 to 0x80 (0x60~0x80)
1625 .type = "rk610_i2c_codec",
1628 .platform_data = &rk610_codec_pdata,
1636 int __sramdata g_pmic_type = 0;
1637 #ifdef CONFIG_I2C1_RK30
1638 #ifdef CONFIG_MFD_WM831X_I2C
1639 #define PMU_POWER_SLEEP RK30_PIN0_PA1
1641 static struct pmu_info wm8326_dcdc_info[] = {
1643 .name = "vdd_core", //logic
1646 .suspend_vol = 950000,
1649 .name = "vdd_cpu", //arm
1652 .suspend_vol = 950000,
1655 .name = "dcdc3", //ddr
1658 .suspend_vol = 1150000,
1660 #ifdef CONFIG_MACH_RK3066_SDK
1662 .name = "dcdc4", //vcc_io
1665 .suspend_vol = 3000000,
1669 .name = "dcdc4", //vcc_io
1672 .suspend_vol = 2800000,
1677 static struct pmu_info wm8326_ldo_info[] = {
1679 .name = "ldo1", //vcc18_cif
1682 .suspend_vol = 1800000,
1685 .name = "ldo2", //vccio_wl
1688 .suspend_vol = 1800000,
1694 .suspend_vol = 1100000,
1697 .name = "ldo4", //vdd11
1700 .suspend_vol = 1000000,
1703 .name = "ldo5", //vcc25
1706 .suspend_vol = 1800000,
1709 .name = "ldo6", //vcc33
1712 .suspend_vol = 3300000,
1715 .name = "ldo7", //vcc28_cif
1718 .suspend_vol = 2800000,
1721 .name = "ldo8", //vcca33
1724 .suspend_vol = 3300000,
1727 .name = "ldo9", //vcc_tp
1730 .suspend_vol = 3300000,
1733 .name = "ldo10", //flash_io
1736 .suspend_vol = 1800000,
1740 #include "board-pmu-wm8326.c"
1743 #ifdef CONFIG_MFD_TPS65910
1744 #define TPS65910_HOST_IRQ RK30_PIN0_PB3
1746 #define PMU_POWER_SLEEP RK30_PIN0_PA1
1748 static struct pmu_info tps65910_dcdc_info[] = {
1750 .name = "vdd_core", //logic
1755 .name = "vdd2", //ddr
1760 .name = "vio", //vcc_io
1766 static struct pmu_info tps65910_ldo_info[] = {
1768 .name = "vpll", //vdd10
1773 .name = "vdig1", //vcc18_cif
1778 .name = "vdig2", //vdd_jetta
1783 .name = "vaux1", //vcc28_cif
1788 .name = "vaux2", //vcca33
1793 .name = "vaux33", //vcc_tp
1798 .name = "vmmc", //vcc30
1803 .name = "vdac", //vcc18
1809 #include "board-pmu-tps65910.c"
1812 #ifdef CONFIG_REGULATOR_ACT8846
1813 #define PMU_POWER_SLEEP RK30_PIN0_PA1
1814 #define PMU_VSEL RK30_PIN3_PD3
1815 static struct pmu_info act8846_dcdc_info[] = {
1817 .name = "act_dcdc1", //ddr
1820 .suspend_vol = 1200000,
1823 .name = "vdd_core", //logic
1826 #ifdef CONFIG_ACT8846_SUPPORT_RESET
1827 .suspend_vol = 1200000,
1829 .suspend_vol = 900000,
1834 .name = "vdd_cpu", //arm
1837 #ifdef CONFIG_ACT8846_SUPPORT_RESET
1838 .suspend_vol = 1200000,
1840 .suspend_vol = 900000,
1845 .name = "act_dcdc4", //vccio
1848 #ifdef CONFIG_ACT8846_SUPPORT_RESET
1849 .suspend_vol = 3000000,
1851 .suspend_vol = 2800000,
1857 static struct pmu_info act8846_ldo_info[] = {
1859 .name = "act_ldo1", //vdd11
1864 .name = "act_ldo2", //vdd12
1869 .name = "act_ldo3", //vcc18_cif
1874 .name = "act_ldo4", //vcca33
1879 .name = "act_ldo5", //vcctp
1884 .name = "act_ldo6", //vcc33
1889 .name = "act_ldo7", //vccio_wl
1894 .name = "act_ldo8", //vcc28_cif
1900 #include "board-pmu-act8846.c"
1903 #ifdef CONFIG_MFD_RK808
1904 #define PMU_POWER_SLEEP RK30_PIN0_PA1
1905 #define RK808_HOST_IRQ RK30_PIN0_PB3
1907 static struct pmu_info rk808_dcdc_info[] = {
1909 .name = "vdd_cpu", //arm
1912 .suspend_vol = 900000,
1915 .name = "vdd_core", //logic
1918 .suspend_vol = 900000,
1921 .name = "rk_dcdc3", //ddr
1924 .suspend_vol = 1200000,
1927 .name = "rk_dcdc4", //vccio
1930 .suspend_vol = 3000000,
1934 static struct pmu_info rk808_ldo_info[] = {
1936 .name = "rk_ldo1", //vcc33
1939 .suspend_vol = 3300000,
1942 .name = "rk_ldo2", //vcctp
1945 .suspend_vol = 3300000,
1949 .name = "rk_ldo3", //vdd10
1952 .suspend_vol = 1000000,
1955 .name = "rk_ldo4", //vcc18
1958 .suspend_vol = 1800000,
1961 .name = "rk_ldo5", //vcc28_cif
1964 .suspend_vol = 2800000,
1967 .name = "rk_ldo6", //vdd12
1970 .suspend_vol = 1200000,
1973 .name = "rk_ldo7", //vcc18_cif
1976 .suspend_vol = 1800000,
1979 .name = "rk_ldo8", //vcca_33
1982 .suspend_vol = 3300000,
1986 #include "board-pmu-rk808.c"
1988 #ifdef CONFIG_MFD_RICOH619
1989 #define PMU_POWER_SLEEP RK30_PIN0_PA1
1990 #define RICOH619_HOST_IRQ RK30_PIN0_PB3
1992 static struct pmu_info ricoh619_dcdc_info[] = {
1994 .name = "vdd_cpu", //arm
1997 .suspend_vol = 900000,
2000 .name = "vdd_core", //logic
2003 .suspend_vol = 900000,
2007 .name = "ricoh_dc3", //vcc18
2010 .suspend_vol = 1800000,
2014 .name = "ricoh_dc4", //vccio
2017 .suspend_vol = 3300000,
2021 .name = "ricoh_dc5", //ddr
2024 .suspend_vol = 1200000,
2028 static struct pmu_info ricoh619_ldo_info[] = {
2030 .name = "ricoh_ldo1", //vcc30
2035 .name = "ricoh_ldo2", //vcca33
2040 .name = "ricoh_ldo3", //vcctp
2045 .name = "ricoh_ldo4", //vccsd
2050 .name = "ricoh_ldo5", //vcc18_cif
2055 .name = "ricoh_ldo6", //vdd12
2060 .name = "ricoh_ldo7", //vcc28_cif
2065 .name = "ricoh_ldo8", //vcc25
2070 .name = "ricoh_ldo9", //vdd10
2075 .name = "ricoh_ldo10", //vcca18
2082 #include "board-pmu-ricoh619.c"
2085 #ifdef CONFIG_MFD_RT5025
2086 #define RT5025_HOST_IRQ RK30_PIN0_PB3
2088 static struct pmu_info rt5025_dcdc_info[] = {
2090 .name = "vdd_cpu", //arm
2095 .name = "vdd_core", //logic
2101 .name = "rt5025-dcdc3", //vccio
2107 static struct pmu_info rt5025_ldo_info[] = {
2109 .name = "rt5025-ldo1", //vcc18
2114 .name = "rt5025-ldo2", //vddjetta
2119 .name = "rt5025-ldo3", //vdd10
2124 .name = "rt5025-ldo4", //vccjetta
2129 .name = "rt5025-ldo5", //vccio_wl
2134 .name = "rt5025-ldo6", //vcc_tp
2141 #include "board-pmu-rt5025.c"
2146 static struct i2c_board_info __initdata i2c1_info[] = {
2147 #if defined (CONFIG_MFD_WM831X_I2C)
2152 .irq = RK30_PIN0_PB3,
2153 .platform_data = &wm831x_platdata,
2156 #if defined (CONFIG_MFD_TPS65910)
2159 .addr = TPS65910_I2C_ID0,
2161 .irq = TPS65910_HOST_IRQ,
2162 .platform_data = &tps65910_data,
2166 #if defined (CONFIG_REGULATOR_ACT8846)
2171 // .irq = ACT8846_HOST_IRQ,
2172 .platform_data=&act8846_data,
2175 #if defined (CONFIG_MFD_RK808)
2180 // .irq = ACT8846_HOST_IRQ,
2181 .platform_data=&rk808_data,
2185 #if defined (CONFIG_MFD_RICOH619)
2190 .irq = RICOH619_HOST_IRQ,
2191 .platform_data=&ricoh619_data,
2195 #if defined (CONFIG_MFD_RT5025)
2200 .irq = RT5025_HOST_IRQ,
2201 .platform_data=&rt5025_data,
2205 #if defined (CONFIG_RTC_HYM8563)
2207 .type = "rtc_hym8563",
2210 .irq = RK30_PIN1_PA4,
2212 #if defined (CONFIG_CW2015_BATTERY)
2217 .platform_data = &cw_bat_platdata,
2225 void __sramfunc board_pmu_suspend(void)
2227 #if defined (CONFIG_MFD_WM831X_I2C)
2228 if(pmic_is_wm8326())
2229 board_pmu_wm8326_suspend();
2231 #if defined (CONFIG_MFD_TPS65910)
2232 if(pmic_is_tps65910())
2233 board_pmu_tps65910_suspend();
2235 #if defined (CONFIG_REGULATOR_ACT8846)
2236 if(pmic_is_act8846())
2237 board_pmu_act8846_suspend();
2239 #if defined (CONFIG_MFD_RK808)
2241 board_pmu_rk808_suspend();
2243 #if defined (CONFIG_MFD_RICOH619)
2244 if(pmic_is_ricoh619())
2245 board_pmu_ricoh619_suspend();
2250 void __sramfunc board_pmu_resume(void)
2252 #if defined (CONFIG_MFD_WM831X_I2C)
2253 if(pmic_is_wm8326())
2254 board_pmu_wm8326_resume();
2256 #if defined (CONFIG_MFD_TPS65910)
2257 if(pmic_is_tps65910())
2258 board_pmu_tps65910_resume();
2260 #if defined (CONFIG_REGULATOR_ACT8846)
2261 if(pmic_is_act8846())
2262 board_pmu_act8846_resume();
2264 #if defined (CONFIG_MFD_RK808)
2266 board_pmu_rk808_resume();
2268 #if defined (CONFIG_MFD_RICOH619)
2269 if(pmic_is_ricoh619())
2270 board_pmu_ricoh619_resume();
2275 int __sramdata gpio3d6_iomux,gpio3d6_do,gpio3d6_dir,gpio3d6_en;
2277 #define grf_readl(offset) readl_relaxed(RK30_GRF_BASE + offset)
2278 #define grf_writel(v, offset) do { writel_relaxed(v, RK30_GRF_BASE + offset); dsb(); } while (0)
2280 void __sramfunc rk30_pwm_logic_suspend_voltage(void)
2282 #ifdef CONFIG_RK30_PWM_REGULATOR
2284 // int gpio0d7_iomux,gpio0d7_do,gpio0d7_dir,gpio0d7_en;
2286 gpio3d6_iomux = grf_readl(GRF_GPIO3D_IOMUX);
2287 gpio3d6_do = grf_readl(GRF_GPIO3H_DO);
2288 gpio3d6_dir = grf_readl(GRF_GPIO3H_DIR);
2289 gpio3d6_en = grf_readl(GRF_GPIO3H_EN);
2291 grf_writel((1<<28), GRF_GPIO3D_IOMUX);
2292 grf_writel((1<<30)|(1<<14), GRF_GPIO3H_DIR);
2293 grf_writel((1<<30)|(1<<14), GRF_GPIO3H_DO);
2294 grf_writel((1<<30)|(1<<14), GRF_GPIO3H_EN);
2297 void __sramfunc rk30_pwm_logic_resume_voltage(void)
2299 #ifdef CONFIG_RK30_PWM_REGULATOR
2300 grf_writel((1<<28)|gpio3d6_iomux, GRF_GPIO3D_IOMUX);
2301 grf_writel((1<<30)|gpio3d6_en, GRF_GPIO3H_EN);
2302 grf_writel((1<<30)|gpio3d6_dir, GRF_GPIO3H_DIR);
2303 grf_writel((1<<30)|gpio3d6_do, GRF_GPIO3H_DO);
2309 extern void pwm_suspend_voltage(void);
2310 extern void pwm_resume_voltage(void);
2311 void rk30_pwm_suspend_voltage_set(void)
2313 #ifdef CONFIG_RK30_PWM_REGULATOR
2314 pwm_suspend_voltage();
2317 void rk30_pwm_resume_voltage_set(void)
2319 #ifdef CONFIG_RK30_PWM_REGULATOR
2320 pwm_resume_voltage();
2325 #ifdef CONFIG_I2C2_RK30
2326 static struct i2c_board_info __initdata i2c2_info[] = {
2327 #if defined (CONFIG_TOUCHSCREEN_GT8XX)
2329 .type = "Goodix-TS",
2332 .irq = RK30_PIN1_PB7,
2333 .platform_data = &goodix_info,
2336 #if defined (CONFIG_LS_CM3217)
2338 .type = "lightsensor",
2341 .platform_data = &cm3217_info,
2347 #ifdef CONFIG_I2C3_RK30
2348 static struct i2c_board_info __initdata i2c3_info[] = {
2352 #ifdef CONFIG_I2C4_RK30
2353 static struct i2c_board_info __initdata i2c4_info[] = {
2354 #if defined (CONFIG_MFD_RK616)
2359 .platform_data = &rk616_pdata,
2366 #ifdef CONFIG_I2C_GPIO_RK30
2367 #define I2C_SDA_PIN INVALID_GPIO// RK30_PIN2_PD6 //set sda_pin here
2368 #define I2C_SCL_PIN INVALID_GPIO//RK30_PIN2_PD7 //set scl_pin here
2369 static int rk30_i2c_io_init(void)
2371 //set iomux (gpio) here
2372 //rk30_mux_api_set(GPIO2D7_I2C1SCL_NAME, GPIO2D_GPIO2D7);
2373 //rk30_mux_api_set(GPIO2D6_I2C1SDA_NAME, GPIO2D_GPIO2D6);
2377 struct i2c_gpio_platform_data default_i2c_gpio_data = {
2378 .sda_pin = I2C_SDA_PIN,
2379 .scl_pin = I2C_SCL_PIN,
2380 .udelay = 5, // clk = 500/udelay = 100Khz
2381 .timeout = 100,//msecs_to_jiffies(100),
2383 .io_init = rk30_i2c_io_init,
2385 static struct i2c_board_info __initdata i2c_gpio_info[] = {
2389 static void __init rk30_i2c_register_board_info(void)
2391 #ifdef CONFIG_I2C0_RK30
2392 i2c_register_board_info(0, i2c0_info, ARRAY_SIZE(i2c0_info));
2394 #ifdef CONFIG_I2C1_RK30
2395 i2c_register_board_info(1, i2c1_info, ARRAY_SIZE(i2c1_info));
2397 #ifdef CONFIG_I2C2_RK30
2398 i2c_register_board_info(2, i2c2_info, ARRAY_SIZE(i2c2_info));
2400 #ifdef CONFIG_I2C3_RK30
2401 i2c_register_board_info(3, i2c3_info, ARRAY_SIZE(i2c3_info));
2403 #ifdef CONFIG_I2C4_RK30
2404 i2c_register_board_info(4, i2c4_info, ARRAY_SIZE(i2c4_info));
2406 #ifdef CONFIG_I2C_GPIO_RK30
2407 i2c_register_board_info(5, i2c_gpio_info, ARRAY_SIZE(i2c_gpio_info));
2412 // ========== Begin of rk3168 top board keypad defination ============
2414 #include <plat/key.h>
2416 static struct rk29_keys_button key_button[] = {
2419 .code = KEY_VOLUMEDOWN,
2421 .gpio = INVALID_GPIO,
2422 .active_low = PRESS_LEV_LOW,
2427 .gpio = RK30_PIN0_PA4,
2428 .active_low = PRESS_LEV_LOW,
2433 .code = KEY_VOLUMEUP,
2435 .gpio = INVALID_GPIO,
2436 .active_low = PRESS_LEV_LOW,
2442 .gpio = INVALID_GPIO,
2443 .active_low = PRESS_LEV_LOW,
2449 .gpio = INVALID_GPIO,
2450 .active_low = PRESS_LEV_LOW,
2456 .gpio = INVALID_GPIO,
2457 .active_low = PRESS_LEV_LOW,
2463 .gpio = INVALID_GPIO,
2464 .active_low = PRESS_LEV_LOW,
2467 struct rk29_keys_platform_data rk29_keys_pdata = {
2468 .buttons = key_button,
2469 .nbuttons = ARRAY_SIZE(key_button),
2470 .chn = 1, //chn: 0-7, if do not use ADC,set 'chn' -1
2473 // =========== End of rk3168 top board keypad defination =============
2476 #define POWER_ON_PIN RK30_PIN0_PA0 //power_hold
2477 static void rk30_pm_power_off(void)
2479 printk(KERN_ERR "rk30_pm_power_off start...\n");
2480 #if defined(CONFIG_MFD_WM831X)
2481 if(pmic_is_wm8326()){
2482 wm831x_set_bits(Wm831x,WM831X_GPIO_LEVEL,0x0001,0x0000); //set sys_pwr 0
2483 wm831x_device_shutdown(Wm831x);//wm8326 shutdown
2487 #if defined(CONFIG_REGULATOR_ACT8846)
2488 if(pmic_is_act8846())
2490 act8846_device_shutdown();
2494 #if defined(CONFIG_MFD_TPS65910)
2495 if(pmic_is_tps65910())
2497 tps65910_device_shutdown();//tps65910 shutdown
2501 #if defined(CONFIG_MFD_RK808)
2504 rk808_device_shutdown();//rk808 shutdown
2507 #if defined(CONFIG_MFD_RICOH619)
2508 if(pmic_is_ricoh619()){
2509 ricoh619_power_off(); //ricoh619 shutdown
2513 #if defined(CONFIG_MFD_RT5025)
2514 if(pmic_is_rt5025()){
2515 rt5025_power_off(); //rt5025 shutdown
2519 gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
2523 static void __init machine_rk30_board_init(void)
2526 gpio_request(POWER_ON_PIN, "poweronpin");
2527 gpio_direction_output(POWER_ON_PIN, GPIO_HIGH);
2529 pm_power_off = rk30_pm_power_off;
2531 gpio_direction_output(POWER_ON_PIN, GPIO_HIGH);
2534 rk30_i2c_register_board_info();
2535 spi_register_board_info(board_spi_devices, ARRAY_SIZE(board_spi_devices));
2536 platform_add_devices(devices, ARRAY_SIZE(devices));
2537 rk_platform_add_display_devices();
2538 board_usb_detect_init(RK30_PIN0_PA7);
2540 #if defined(CONFIG_WIFI_CONTROL_FUNC)
2541 rk29sdk_wifi_bt_gpio_control_init();
2542 #elif defined(CONFIG_WIFI_COMBO_MODULE_CONTROL_FUNC)
2543 rk29sdk_wifi_combo_module_gpio_init();
2546 #if defined(CONFIG_MT6620)
2547 clk_set_rate(clk_get_sys("rk_serial.0", "uart"), 48*1000000);
2550 #if defined(CONFIG_MT5931_MT6622)
2551 clk_set_rate(clk_get_sys("rk_serial.0", "uart"), 24*1000000);
2554 #define HD_SCREEN_SIZE 1920UL*1200UL*4*3
2555 static void __init rk30_reserve(void)
2557 #if defined(CONFIG_ARCH_RK3188)
2558 /*if lcd resolution great than or equal to 1920*1200,reserve the ump memory */
2559 if(!(get_fb_size() < ALIGN(HD_SCREEN_SIZE,SZ_1M)))
2561 int ump_mem_phy_size=512UL*1024UL*1024UL;
2562 resource_mali[0].start = board_mem_reserve_add("ump buf", ump_mem_phy_size);
2563 resource_mali[0].end = resource_mali[0].start + ump_mem_phy_size -1;
2567 rk30_ion_pdata.heaps[0].base = board_mem_reserve_add("ion", ION_RESERVE_SIZE);
2569 #ifdef CONFIG_FB_ROCKCHIP
2570 resource_fb[0].start = board_mem_reserve_add("fb0 buf", get_fb_size());
2571 resource_fb[0].end = resource_fb[0].start + get_fb_size()- 1;
2573 resource_fb[1].start = board_mem_reserve_add("ipp buf", RK30_FB0_MEM_SIZE);
2574 resource_fb[1].end = resource_fb[1].start + RK30_FB0_MEM_SIZE - 1;
2577 #if defined(CONFIG_FB_ROTATE) || !defined(CONFIG_THREE_FB_BUFFER)
2578 resource_fb[2].start = board_mem_reserve_add("fb2 buf",get_fb_size());
2579 resource_fb[2].end = resource_fb[2].start + get_fb_size() - 1;
2583 #ifdef CONFIG_VIDEO_RK29
2584 rk30_camera_request_reserve_mem();
2587 #ifdef CONFIG_GPS_RK
2588 //it must be more than 8MB
2589 rk_gps_info.u32MemoryPhyAddr = board_mem_reserve_add("gps", SZ_8M);
2591 board_mem_reserved();
2593 /******************************** arm dvfs frequency volt table **********************************/
2595 * dvfs_cpu_logic_table: table for arm and logic dvfs
2596 * @frequency : arm frequency
2597 * @cpu_volt : arm voltage depend on frequency
2600 #if defined(CONFIG_ARCH_RK3188)
2602 static struct cpufreq_frequency_table dvfs_arm_table_volt_level0[] = {
2603 {.frequency = 312 * 1000, .index = 850 * 1000},
2604 {.frequency = 504 * 1000, .index = 900 * 1000},
2605 {.frequency = 816 * 1000, .index = 950 * 1000},
2606 {.frequency = 1008 * 1000, .index = 1025 * 1000},
2607 {.frequency = 1200 * 1000, .index = 1100 * 1000},
2608 {.frequency = 1416 * 1000, .index = 1200 * 1000},
2609 {.frequency = 1608 * 1000, .index = 1300 * 1000},
2610 {.frequency = CPUFREQ_TABLE_END},
2613 static struct cpufreq_frequency_table dvfs_arm_table_volt_level1[] = {
2614 {.frequency = 312 * 1000, .index = 875 * 1000},
2615 {.frequency = 504 * 1000, .index = 925 * 1000},
2616 {.frequency = 816 * 1000, .index = 975 * 1000},
2617 {.frequency = 1008 * 1000, .index = 1075 * 1000},
2618 {.frequency = 1200 * 1000, .index = 1150 * 1000},
2619 {.frequency = 1416 * 1000, .index = 1250 * 1000},
2620 {.frequency = 1608 * 1000, .index = 1350 * 1000},
2621 {.frequency = CPUFREQ_TABLE_END},
2624 static struct cpufreq_frequency_table dvfs_arm_table_volt_level2[] = {
2625 {.frequency = 312 * 1000, .index = 900 * 1000},
2626 {.frequency = 504 * 1000, .index = 925 * 1000},
2627 {.frequency = 816 * 1000, .index = 1000 * 1000},
2628 {.frequency = 1008 * 1000, .index = 1075 * 1000},
2629 {.frequency = 1200 * 1000, .index = 1200 * 1000},
2630 {.frequency = 1416 * 1000, .index = 1250 * 1000},
2631 {.frequency = 1608 * 1000, .index = 1350 * 1000},
2632 {.frequency = CPUFREQ_TABLE_END},
2635 /******************************** gpu dvfs frequency volt table **********************************/
2637 static struct cpufreq_frequency_table dvfs_gpu_table_volt_level0[] = {
2638 {.frequency = 133 * 1000, .index = 975 * 1000},//the mininum rate is limited 133M for rk3188
2639 {.frequency = 200 * 1000, .index = 975 * 1000},
2640 {.frequency = 266 * 1000, .index = 1000 * 1000},
2641 {.frequency = 300 * 1000, .index = 1050 * 1000},
2642 {.frequency = 400 * 1000, .index = 1100 * 1000},
2643 {.frequency = 600 * 1000, .index = 1200 * 1000},
2644 {.frequency = CPUFREQ_TABLE_END},
2647 static struct cpufreq_frequency_table dvfs_gpu_table_volt_level1[] = {
2648 {.frequency = 133 * 1000, .index = 975 * 1000},//the mininum rate is limited 133M for rk3188
2649 {.frequency = 200 * 1000, .index = 1000 * 1000},
2650 {.frequency = 266 * 1000, .index = 1025 * 1000},
2651 {.frequency = 300 * 1000, .index = 1050 * 1000},
2652 {.frequency = 400 * 1000, .index = 1100 * 1000},
2653 {.frequency = 600 * 1000, .index = 1250 * 1000},
2654 {.frequency = CPUFREQ_TABLE_END},
2657 /******************************** ddr dvfs frequency volt table **********************************/
2658 static struct cpufreq_frequency_table dvfs_ddr_table_volt_level0[] = {
2659 {.frequency = 200 * 1000 + DDR_FREQ_SUSPEND, .index = 950 * 1000},
2660 {.frequency = 300 * 1000 + DDR_FREQ_VIDEO, .index = 1000 * 1000},
2661 {.frequency = 396 * 1000 + DDR_FREQ_NORMAL, .index = 1100 * 1000},
2662 {.frequency = 460 * 1000 + DDR_FREQ_DUALVIEW, .index = 1150 * 1000},
2663 //{.frequency = 528 * 1000 + DDR_FREQ_NORMAL, .index = 1200 * 1000},
2664 {.frequency = CPUFREQ_TABLE_END},
2667 //if you board is good for volt quality,select dvfs_arm_table_volt_level0
2668 #define dvfs_arm_table dvfs_arm_table_volt_level1
2669 #define dvfs_gpu_table dvfs_gpu_table_volt_level1
2670 #define dvfs_ddr_table dvfs_ddr_table_volt_level0
2673 //for RK3168 && RK3066B
2674 static struct cpufreq_frequency_table dvfs_arm_table[] = {
2675 {.frequency = 312 * 1000, .index = 950 * 1000},
2676 {.frequency = 504 * 1000, .index = 1000 * 1000},
2677 {.frequency = 816 * 1000, .index = 1050 * 1000},
2678 {.frequency = 1008 * 1000, .index = 1125 * 1000},
2679 {.frequency = 1200 * 1000, .index = 1200 * 1000},
2680 //{.frequency = 1416 * 1000, .index = 1250 * 1000},
2681 //{.frequency = 1608 * 1000, .index = 1300 * 1000},
2682 {.frequency = CPUFREQ_TABLE_END},
2685 static struct cpufreq_frequency_table dvfs_gpu_table[] = {
2686 {.frequency = 100 * 1000, .index = 1000 * 1000},
2687 {.frequency = 200 * 1000, .index = 1000 * 1000},
2688 {.frequency = 266 * 1000, .index = 1050 * 1000},
2689 //{.frequency = 300 * 1000, .index = 1050 * 1000},
2690 {.frequency = 400 * 1000, .index = 1125 * 1000},
2691 {.frequency = CPUFREQ_TABLE_END},
2694 static struct cpufreq_frequency_table dvfs_ddr_table[] = {
2695 {.frequency = 200 * 1000 + DDR_FREQ_SUSPEND, .index = 1000 * 1000},
2696 {.frequency = 300 * 1000 + DDR_FREQ_VIDEO, .index = 1050 * 1000},
2697 {.frequency = 400 * 1000 + DDR_FREQ_NORMAL, .index = 1100 * 1000},
2698 {.frequency = 450 * 1000, .index = 1150 * 1000},
2699 {.frequency = CPUFREQ_TABLE_END},
2702 /******************************** arm dvfs frequency volt table end **********************************/
2703 //#define DVFS_CPU_TABLE_SIZE (ARRAY_SIZE(dvfs_cpu_logic_table))
2704 //static struct cpufreq_frequency_table cpu_dvfs_table[DVFS_CPU_TABLE_SIZE];
2705 //static struct cpufreq_frequency_table dep_cpu2core_table[DVFS_CPU_TABLE_SIZE];
2706 int get_max_freq(struct cpufreq_frequency_table *table)
2710 for(i=0;table[i].frequency!= CPUFREQ_TABLE_END;i++)
2712 if(temp<table[i].frequency)
2713 temp=table[i].frequency;
2715 printk("get_max_freq=%d\n",temp);
2719 void __init board_clock_init(void)
2721 u32 flags=RK30_CLOCKS_DEFAULT_FLAGS;
2722 #if !defined(CONFIG_ARCH_RK3188)
2723 if(get_max_freq(dvfs_gpu_table)<=(400*1000))
2725 flags=RK30_CLOCKS_DEFAULT_FLAGS|CLK_GPU_GPLL;
2728 flags=RK30_CLOCKS_DEFAULT_FLAGS|CLK_GPU_CPLL;
2730 rk30_clock_data_init(periph_pll_default, codec_pll_default, flags);
2731 //dvfs_set_arm_logic_volt(dvfs_cpu_logic_table, cpu_dvfs_table, dep_cpu2core_table);
2732 dvfs_set_freq_volt_table(clk_get(NULL, "cpu"), dvfs_arm_table);
2733 dvfs_set_freq_volt_table(clk_get(NULL, "gpu"), dvfs_gpu_table);
2734 dvfs_set_freq_volt_table(clk_get(NULL, "ddr"), dvfs_ddr_table);
2737 MACHINE_START(RK30, "RK30board")
2738 .boot_params = PLAT_PHYS_OFFSET + 0x800,
2739 .fixup = rk30_fixup,
2740 .reserve = &rk30_reserve,
2741 .map_io = rk30_map_io,
2742 .init_irq = rk30_init_irq,
2743 .timer = &rk30_timer,
2744 .init_machine = machine_rk30_board_init,