1 /* arch/arm/mach-rk30/board-rk30-sdk.c
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>
44 #include <linux/regulator/machine.h>
45 #include <linux/rfkill-rk.h>
46 #include <linux/sensor-dev.h>
47 #include <linux/regulator/rk29-pwm-regulator.h>
49 #if defined(CONFIG_MFD_RK610)
50 #include <linux/mfd/rk610_core.h>
53 #if defined(CONFIG_RK_HDMI)
54 #include "../../../drivers/video/rockchip/hdmi/rk_hdmi.h"
57 #if defined(CONFIG_SPIM_RK29)
58 #include "../../../drivers/spi/rk29_spim.h"
60 #if defined(CONFIG_MU509)
61 #include <linux/mu509.h>
63 #if defined(CONFIG_MW100)
64 #include <linux/mw100.h>
66 #if defined(CONFIG_MT6229)
67 #include <linux/mt6229.h>
69 #if defined(CONFIG_SEW868)
70 #include <linux/sew868.h>
72 #if defined(CONFIG_ANDROID_TIMED_GPIO)
73 #include "../../../drivers/staging/android/timed_gpio.h"
76 #if defined(CONFIG_MT6620)
77 #include <linux/gps.h>
80 #ifdef CONFIG_THREE_FB_BUFFER
81 #define RK30_FB0_MEM_SIZE 12*SZ_1M
83 #define RK30_FB0_MEM_SIZE 8*SZ_1M
86 #include "board-rk30-sdk-camera.c"
87 #include "board-rk30-sdk-key.c"
89 #if defined(CONFIG_TOUCHSCREEN_GT8XX)
90 #define TOUCH_RESET_PIN RK30_PIN4_PD0
91 #define TOUCH_PWR_PIN INVALID_GPIO
92 int goodix_init_platform_hw(void)
96 rk30_mux_api_set(GPIO4D0_SMCDATA8_TRACEDATA8_NAME, GPIO4D_GPIO4D0);
97 rk30_mux_api_set(GPIO4C2_SMCDATA2_TRACEDATA2_NAME, GPIO4C_GPIO4C2);
98 printk("%s:0x%x,0x%x\n",__func__,rk30_mux_api_get(GPIO4D0_SMCDATA8_TRACEDATA8_NAME),rk30_mux_api_get(GPIO4C2_SMCDATA2_TRACEDATA2_NAME));
100 if (TOUCH_PWR_PIN != INVALID_GPIO) {
101 ret = gpio_request(TOUCH_PWR_PIN, "goodix power pin");
103 gpio_free(TOUCH_PWR_PIN);
104 printk("goodix power error\n");
107 gpio_direction_output(TOUCH_PWR_PIN, 0);
108 gpio_set_value(TOUCH_PWR_PIN, GPIO_LOW);
112 if (TOUCH_RESET_PIN != INVALID_GPIO) {
113 ret = gpio_request(TOUCH_RESET_PIN, "goodix reset pin");
115 gpio_free(TOUCH_RESET_PIN);
116 printk("goodix gpio_request error\n");
119 gpio_direction_output(TOUCH_RESET_PIN, 1);
121 //gpio_set_value(TOUCH_RESET_PIN, GPIO_LOW);
123 //gpio_set_value(TOUCH_RESET_PIN, GPIO_HIGH);
129 struct goodix_platform_data goodix_info = {
131 .irq_pin = RK30_PIN4_PC2,
132 .rest_pin = TOUCH_RESET_PIN,
133 .init_platform_hw = goodix_init_platform_hw,
137 static struct spi_board_info board_spi_devices[] = {
140 /***********************************************************
142 ************************************************************/
143 #ifdef CONFIG_BACKLIGHT_RK29_BL
145 #define PWM_MUX_NAME GPIO0A3_PWM0_NAME
146 #define PWM_MUX_MODE GPIO0A_PWM0
147 #define PWM_MUX_MODE_GPIO GPIO0A_GPIO0A3
148 #define PWM_GPIO RK30_PIN0_PA3
149 #define PWM_EFFECT_VALUE 1
151 #define LCD_DISP_ON_PIN
153 #ifdef LCD_DISP_ON_PIN
154 //#define BL_EN_MUX_NAME GPIOF34_UART3_SEL_NAME
155 //#define BL_EN_MUX_MODE IOMUXB_GPIO1_B34
157 #define BL_EN_PIN RK30_PIN6_PB3
158 #define BL_EN_VALUE GPIO_HIGH
160 static int rk29_backlight_io_init(void)
163 rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
164 #ifdef LCD_DISP_ON_PIN
165 // rk30_mux_api_set(BL_EN_MUX_NAME, BL_EN_MUX_MODE);
167 ret = gpio_request(BL_EN_PIN, NULL);
169 gpio_free(BL_EN_PIN);
172 gpio_direction_output(BL_EN_PIN, 0);
173 gpio_set_value(BL_EN_PIN, BL_EN_VALUE);
178 static int rk29_backlight_io_deinit(void)
181 #ifdef LCD_DISP_ON_PIN
182 gpio_free(BL_EN_PIN);
184 rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE_GPIO);
188 static int rk29_backlight_pwm_suspend(void)
191 rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE_GPIO);
192 if (gpio_request(PWM_GPIO, NULL)) {
193 printk("func %s, line %d: request gpio fail\n", __FUNCTION__, __LINE__);
196 gpio_direction_output(PWM_GPIO, GPIO_LOW);
197 #ifdef LCD_DISP_ON_PIN
198 gpio_direction_output(BL_EN_PIN, 0);
199 gpio_set_value(BL_EN_PIN, !BL_EN_VALUE);
204 static int rk29_backlight_pwm_resume(void)
207 rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
208 #ifdef LCD_DISP_ON_PIN
210 gpio_direction_output(BL_EN_PIN, 1);
211 gpio_set_value(BL_EN_PIN, BL_EN_VALUE);
216 static struct rk29_bl_info rk29_bl_info = {
218 .bl_ref = PWM_EFFECT_VALUE,
219 .io_init = rk29_backlight_io_init,
220 .io_deinit = rk29_backlight_io_deinit,
221 .pwm_suspend = rk29_backlight_pwm_suspend,
222 .pwm_resume = rk29_backlight_pwm_resume,
225 static struct platform_device rk29_device_backlight = {
226 .name = "rk29_backlight",
229 .platform_data = &rk29_bl_info,
235 #ifdef CONFIG_RK29_SUPPORT_MODEM
237 #define RK30_MODEM_POWER RK30_PIN4_PD1
238 #define RK30_MODEM_POWER_IOMUX rk29_mux_api_set(GPIO4D1_SMCDATA9_TRACEDATA9_NAME, GPIO4D_GPIO4D1)
240 static int rk30_modem_io_init(void)
242 printk("%s\n", __FUNCTION__);
243 RK30_MODEM_POWER_IOMUX;
248 static struct rk29_io_t rk30_modem_io = {
249 .io_addr = RK30_MODEM_POWER,
252 .io_init = rk30_modem_io_init,
255 static struct platform_device rk30_device_modem = {
256 .name = "rk30_modem",
259 .platform_data = &rk30_modem_io,
263 #if defined(CONFIG_MU509)
264 static int mu509_io_init(void)
267 rk30_mux_api_set(GPIO2B6_LCDC1DATA14_SMCADDR18_TSSYNC_NAME, GPIO2B_GPIO2B6);
268 rk30_mux_api_set(GPIO4D2_SMCDATA10_TRACEDATA10_NAME, GPIO4D_GPIO4D2);
269 rk30_mux_api_set(GPIO2B7_LCDC1DATA15_SMCADDR19_HSADCDATA7_NAME, GPIO2B_GPIO2B7);
270 rk30_mux_api_set(GPIO2C0_LCDCDATA16_GPSCLK_HSADCCLKOUT_NAME, GPIO2C_GPIO2C0);
274 static int mu509_io_deinit(void)
280 struct rk29_mu509_data rk29_mu509_info = {
281 .io_init = mu509_io_init,
282 .io_deinit = mu509_io_deinit,
283 .modem_power_en = RK30_PIN6_PB2,//RK30_PIN4_PD1,
284 .bp_power = RK30_PIN2_PB6,//RK30_PIN4_PD1,
285 .bp_reset = RK30_PIN4_PD2,
286 .ap_wakeup_bp = RK30_PIN2_PB7,
287 .bp_wakeup_ap = RK30_PIN6_PA0,
289 struct platform_device rk29_device_mu509 = {
293 .platform_data = &rk29_mu509_info,
297 #if defined(CONFIG_MW100)
298 static int mw100_io_init(void)
300 rk30_mux_api_set(GPIO2B6_LCDC1DATA14_SMCADDR18_TSSYNC_NAME, GPIO2B_GPIO2B6);
301 rk30_mux_api_set(GPIO4D2_SMCDATA10_TRACEDATA10_NAME, GPIO4D_GPIO4D2);
302 rk30_mux_api_set(GPIO2B7_LCDC1DATA15_SMCADDR19_HSADCDATA7_NAME, GPIO2B_GPIO2B7);
303 rk30_mux_api_set(GPIO2C0_LCDCDATA16_GPSCLK_HSADCCLKOUT_NAME, GPIO2C_GPIO2C0);
307 static int mw100_io_deinit(void)
313 struct rk29_mw100_data rk29_mw100_info = {
314 .io_init = mw100_io_init,
315 .io_deinit = mw100_io_deinit,
316 .modem_power_en = RK30_PIN6_PB2,
317 .bp_power = RK30_PIN2_PB6,
318 .bp_reset = RK30_PIN4_PD2,
319 .ap_wakeup_bp = RK30_PIN2_PB7,
320 .bp_wakeup_ap = RK30_PIN6_PA0,
322 struct platform_device rk29_device_mw100 = {
326 .platform_data = &rk29_mw100_info,
330 #if defined(CONFIG_MT6229)
331 static int mt6229_io_init(void)
333 rk30_mux_api_set(GPIO2B6_LCDC1DATA14_SMCADDR18_TSSYNC_NAME, GPIO2B_GPIO2B6);
334 rk30_mux_api_set(GPIO4D2_SMCDATA10_TRACEDATA10_NAME, GPIO4D_GPIO4D2);
335 rk30_mux_api_set(GPIO2B7_LCDC1DATA15_SMCADDR19_HSADCDATA7_NAME, GPIO2B_GPIO2B7);
336 rk30_mux_api_set(GPIO2C0_LCDCDATA16_GPSCLK_HSADCCLKOUT_NAME, GPIO2C_GPIO2C0);
337 rk30_mux_api_set(GPIO2C1_LCDC1DATA17_SMCBLSN0_HSADCDATA6_NAME, GPIO2C_GPIO2C1);
338 rk30_mux_api_set(GPIO2C1_LCDC1DATA17_SMCBLSN0_HSADCDATA6_NAME, GPIO2C_GPIO2C1);
344 static int mt6229_io_deinit(void)
350 struct rk29_mt6229_data rk29_mt6229_info = {
351 .io_init = mt6229_io_init,
352 .io_deinit = mt6229_io_deinit,
353 .modem_power_en = RK30_PIN6_PB2,
354 .bp_power = RK30_PIN2_PB6,
355 .modem_usb_en = RK30_PIN2_PC0,
356 .modem_uart_en = RK30_PIN2_PC1,
357 .bp_wakeup_ap = RK30_PIN6_PA1,
358 .ap_ready = RK30_PIN2_PB7,
361 struct platform_device rk29_device_mt6229 = {
365 .platform_data = &rk29_mt6229_info,
369 #if defined(CONFIG_SEW868)
370 static int sew868_io_init(void)
372 rk30_mux_api_set(GPIO2B6_LCDC1DATA14_SMCADDR18_TSSYNC_NAME, GPIO2B_GPIO2B6);
373 rk30_mux_api_set(GPIO4D2_SMCDATA10_TRACEDATA10_NAME, GPIO4D_GPIO4D2);
374 rk30_mux_api_set(GPIO4D4_SMCDATA12_TRACEDATA12_NAME, GPIO4D_GPIO4D4);
377 static int sew868_io_deinit(void)
381 struct rk30_sew868_data rk30_sew868_info = {
382 .io_init = sew868_io_init,
383 .io_deinit = sew868_io_deinit,
384 .bp_power = RK30_PIN6_PB2,
385 .bp_power_active_low = 1,
386 .bp_sys = RK30_PIN2_PB6,
387 .bp_reset = RK30_PIN4_PD2,
388 .bp_reset_active_low = 1,
389 .bp_wakeup_ap = RK30_PIN4_PD4,
390 .ap_wakeup_bp = NULL,
393 struct platform_device rk30_device_sew868 = {
397 .platform_data = &rk30_sew868_info,
403 #if defined (CONFIG_GS_MMA8452)
404 #define MMA8452_INT_PIN RK30_PIN4_PC0
406 static int mma8452_init_platform_hw(void)
408 rk30_mux_api_set(GPIO4C0_SMCDATA0_TRACEDATA0_NAME, GPIO4C_GPIO4C0);
413 static struct sensor_platform_data mma8452_info = {
414 .type = SENSOR_TYPE_ACCEL,
417 .init_platform_hw = mma8452_init_platform_hw,
418 .orientation = {-1, 0, 0, 0, 0, 1, 0, -1, 0},
421 #if defined (CONFIG_GS_LIS3DH)
422 #define LIS3DH_INT_PIN RK30_PIN4_PC0
424 static int lis3dh_init_platform_hw(void)
426 rk30_mux_api_set(GPIO4C0_SMCDATA0_TRACEDATA0_NAME, GPIO4C_GPIO4C0);
431 static struct sensor_platform_data lis3dh_info = {
432 .type = SENSOR_TYPE_ACCEL,
435 .init_platform_hw = lis3dh_init_platform_hw,
436 .orientation = {-1, 0, 0, 0, 0, 1, 0, -1, 0},
439 #if defined (CONFIG_GS_KXTIK)
440 #define KXTIK_INT_PIN RK30_PIN4_PC0
442 static int kxtik_init_platform_hw(void)
444 rk30_mux_api_set(GPIO4C0_SMCDATA0_TRACEDATA0_NAME, GPIO4C_GPIO4C0);
449 static struct sensor_platform_data kxtik_info = {
450 .type = SENSOR_TYPE_ACCEL,
453 .init_platform_hw = kxtik_init_platform_hw,
454 .orientation = {0, 1, 0, 0, 0, -1, 1, 0, 0},
458 #if defined (CONFIG_COMPASS_AK8975)
459 static struct sensor_platform_data akm8975_info =
461 .type = SENSOR_TYPE_COMPASS,
494 #if defined(CONFIG_GYRO_L3G4200D)
496 #include <linux/l3g4200d.h>
497 #define L3G4200D_INT_PIN RK30_PIN4_PC3
499 static int l3g4200d_init_platform_hw(void)
501 rk30_mux_api_set(GPIO4C3_SMCDATA3_TRACEDATA3_NAME, GPIO4C_GPIO4C3);
506 static struct sensor_platform_data l3g4200d_info = {
507 .type = SENSOR_TYPE_GYROSCOPE,
510 .orientation = {0, 1, 0, -1, 0, 0, 0, 0, 1},
511 .init_platform_hw = l3g4200d_init_platform_hw,
512 .x_min = 40,//x_min,y_min,z_min = (0-100) according to hardware
519 #ifdef CONFIG_LS_CM3217
520 static struct sensor_platform_data cm3217_info = {
521 .type = SENSOR_TYPE_LIGHT,
523 .poll_delay_ms = 500,
528 #if defined(CONFIG_PS_AL3006)
529 static struct sensor_platform_data proximity_al3006_info = {
530 .type = SENSOR_TYPE_PROXIMITY,
532 .poll_delay_ms = 200,
536 #if defined(CONFIG_PS_STK3171)
537 static struct sensor_platform_data proximity_stk3171_info = {
538 .type = SENSOR_TYPE_PROXIMITY,
540 .poll_delay_ms = 200,
545 #if defined(CONFIG_LS_AL3006)
546 static struct sensor_platform_data light_al3006_info = {
547 .type = SENSOR_TYPE_LIGHT,
549 .poll_delay_ms = 200,
553 #if defined(CONFIG_LS_STK3171)
554 static struct sensor_platform_data light_stk3171_info = {
555 .type = SENSOR_TYPE_LIGHT,
557 .poll_delay_ms = 200,
560 #ifdef CONFIG_FB_ROCKCHIP
562 #define LCD_CS_MUX_NAME GPIO4C7_SMCDATA7_TRACEDATA7_NAME
563 #define LCD_CS_PIN RK30_PIN4_PC7
564 #define LCD_CS_VALUE GPIO_HIGH
566 #define LCD_EN_MUX_NAME GPIO4C7_SMCDATA7_TRACEDATA7_NAME
567 #define LCD_EN_PIN RK30_PIN6_PB4
568 #define LCD_EN_VALUE GPIO_LOW
570 static int rk_fb_io_init(struct rk29_fb_setting_info *fb_setting)
573 rk30_mux_api_set(LCD_CS_MUX_NAME, GPIO4C_GPIO4C7);
574 ret = gpio_request(LCD_CS_PIN, NULL);
577 gpio_free(LCD_CS_PIN);
578 printk(KERN_ERR "request lcd cs pin fail!\n");
583 gpio_direction_output(LCD_CS_PIN, LCD_CS_VALUE);
585 ret = gpio_request(LCD_EN_PIN, NULL);
588 gpio_free(LCD_EN_PIN);
589 printk(KERN_ERR "request lcd en pin fail!\n");
594 gpio_direction_output(LCD_EN_PIN, LCD_EN_VALUE);
598 static int rk_fb_io_disable(void)
600 gpio_set_value(LCD_CS_PIN, LCD_CS_VALUE? 0:1);
601 gpio_set_value(LCD_EN_PIN, LCD_EN_VALUE? 0:1);
604 static int rk_fb_io_enable(void)
606 gpio_set_value(LCD_CS_PIN, LCD_CS_VALUE);
607 gpio_set_value(LCD_EN_PIN, LCD_EN_VALUE);
611 #if defined(CONFIG_LCDC0_RK30)
612 struct rk29fb_info lcdc0_screen_info = {
613 .prop = PRMRY, //primary display device
614 .io_init = rk_fb_io_init,
615 .io_disable = rk_fb_io_disable,
616 .io_enable = rk_fb_io_enable,
617 .set_screen_info = set_lcd_info,
621 #if defined(CONFIG_LCDC1_RK30)
622 struct rk29fb_info lcdc1_screen_info = {
623 #if defined(CONFIG_RK_HDMI)
624 .prop = EXTEND, //extend display device
626 .set_screen_info = hdmi_init_lcdc,
631 static struct resource resource_fb[] = {
635 .end = 0,//RK30_FB0_MEM_SIZE - 1,
636 .flags = IORESOURCE_MEM,
639 .name = "ipp buf", //for rotate
641 .end = 0,//RK30_FB0_MEM_SIZE - 1,
642 .flags = IORESOURCE_MEM,
647 .end = 0,//RK30_FB0_MEM_SIZE - 1,
648 .flags = IORESOURCE_MEM,
652 static struct platform_device device_fb = {
655 .num_resources = ARRAY_SIZE(resource_fb),
656 .resource = resource_fb,
660 #if defined(CONFIG_LCDC0_RK30)
661 static struct resource resource_lcdc0[] = {
664 .start = RK30_LCDC0_PHYS,
665 .end = RK30_LCDC0_PHYS + RK30_LCDC0_SIZE - 1,
666 .flags = IORESOURCE_MEM,
673 .flags = IORESOURCE_IRQ,
677 static struct platform_device device_lcdc0 = {
680 .num_resources = ARRAY_SIZE(resource_lcdc0),
681 .resource = resource_lcdc0,
683 .platform_data = &lcdc0_screen_info,
687 #if defined(CONFIG_LCDC1_RK30)
688 extern struct rk29fb_info lcdc1_screen_info;
689 static struct resource resource_lcdc1[] = {
692 .start = RK30_LCDC1_PHYS,
693 .end = RK30_LCDC1_PHYS + RK30_LCDC1_SIZE - 1,
694 .flags = IORESOURCE_MEM,
700 .flags = IORESOURCE_IRQ,
704 static struct platform_device device_lcdc1 = {
707 .num_resources = ARRAY_SIZE(resource_lcdc1),
708 .resource = resource_lcdc1,
710 .platform_data = &lcdc1_screen_info,
715 #if defined(CONFIG_MFD_RK610)
716 #define RK610_RST_PIN_MUX_NAME GPIO0C6_TRACECLK_SMCADDR2_NAME
717 #define RK610_RST_PIN_MUX_MODE GPIO0C_GPIO0C6
718 #define RK610_RST_PIN RK30_PIN0_PC6
719 static int rk610_power_on_init(void)
722 if(RK610_RST_PIN != INVALID_GPIO)
724 rk30_mux_api_set(RK610_RST_PIN_MUX_NAME,RK610_RST_PIN_MUX_MODE);
725 ret = gpio_request(RK610_RST_PIN, "rk610 reset");
728 printk(KERN_ERR "rk610_control_probe request gpio fail\n");
732 gpio_direction_output(RK610_RST_PIN, GPIO_HIGH);
734 gpio_direction_output(RK610_RST_PIN, GPIO_LOW);
736 gpio_set_value(RK610_RST_PIN, GPIO_HIGH);
745 static struct rk610_ctl_platform_data rk610_ctl_pdata = {
746 .rk610_power_on_init = rk610_power_on_init,
750 #ifdef CONFIG_ANDROID_TIMED_GPIO
751 static struct timed_gpio timed_gpios[] = {
754 .gpio = RK30_PIN0_PA4,
757 .adjust_time =20, //adjust for diff product
761 static struct timed_gpio_platform_data rk29_vibrator_info = {
763 .gpios = timed_gpios,
766 static struct platform_device rk29_device_vibrator = {
767 .name = "timed-gpio",
770 .platform_data = &rk29_vibrator_info,
776 #ifdef CONFIG_LEDS_GPIO_PLATFORM
777 static struct gpio_led rk29_leds[] = {
779 .name = "button-backlight",
780 .gpio = RK30_PIN4_PD7,
781 .default_trigger = "timer",
783 .retain_state_suspended = 0,
784 .default_state = LEDS_GPIO_DEFSTATE_OFF,
788 static struct gpio_led_platform_data rk29_leds_pdata = {
790 .num_leds = ARRAY_SIZE(rk29_leds),
793 static struct platform_device rk29_device_gpio_leds = {
797 .platform_data = &rk29_leds_pdata,
802 #ifdef CONFIG_RK_IRDA
803 #define IRDA_IRQ_PIN RK30_PIN6_PA1
805 static int irda_iomux_init(void)
810 ret = gpio_request(IRDA_IRQ_PIN, NULL);
812 gpio_free(IRDA_IRQ_PIN);
813 printk(">>>>>> IRDA_IRQ_PIN gpio_request err \n ");
815 gpio_pull_updown(IRDA_IRQ_PIN, PullDisable);
816 gpio_direction_input(IRDA_IRQ_PIN);
821 static int irda_iomux_deinit(void)
823 gpio_free(IRDA_IRQ_PIN);
827 static struct irda_info rk29_irda_info = {
828 .intr_pin = IRDA_IRQ_PIN,
829 .iomux_init = irda_iomux_init,
830 .iomux_deinit = irda_iomux_deinit,
831 //.irda_pwr_ctl = bu92747guw_power_ctl,
834 static struct platform_device irda_device = {
835 #ifdef CONFIG_RK_IRDA_NET
838 .name = "bu92747_irda",
842 .platform_data = &rk29_irda_info,
848 #define ION_RESERVE_SIZE (80 * SZ_1M)
849 static struct ion_platform_data rk30_ion_pdata = {
853 .type = ION_HEAP_TYPE_CARVEOUT,
854 .id = ION_NOR_HEAP_ID,
856 .size = ION_RESERVE_SIZE,
861 static struct platform_device device_ion = {
862 .name = "ion-rockchip",
865 .platform_data = &rk30_ion_pdata,
870 /**************************************************************************************************
871 * SDMMC devices, include the module of SD,MMC,and sdio.noted by xbw at 2012-03-05
872 **************************************************************************************************/
873 #ifdef CONFIG_SDMMC_RK29
874 #include "board-rk30-sdk-sdmmc.c"
876 #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
877 #define SDMMC0_WRITE_PROTECT_PIN RK30_PIN3_PB2 //According to your own project to set the value of write-protect-pin.
880 #if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
881 #define SDMMC1_WRITE_PROTECT_PIN RK30_PIN3_PB3 //According to your own project to set the value of write-protect-pin.
884 #define RK29SDK_WIFI_SDIO_CARD_DETECT_N RK30_PIN6_PB2
885 #define RK29SDK_WIFI_SDIO_CARD_INT RK30_PIN3_PD2
887 #define RK29SDK_SD_CARD_DETECT_N RK30_PIN3_PB6 //According to your own project to set the value of card-detect-pin.
888 #define RK29SDK_SD_CARD_INSERT_LEVEL GPIO_LOW // set the voltage of insert-card. Please pay attention to the default setting.
889 #endif //endif ---#ifdef CONFIG_SDMMC_RK29
891 #ifdef CONFIG_SDMMC0_RK29
892 static int rk29_sdmmc0_cfg_gpio(void)
894 #ifdef CONFIG_SDMMC_RK29_OLD
895 rk30_mux_api_set(GPIO3B1_SDMMC0CMD_NAME, GPIO3B_SDMMC0_CMD);
896 rk30_mux_api_set(GPIO3B0_SDMMC0CLKOUT_NAME, GPIO3B_SDMMC0_CLKOUT);
897 rk30_mux_api_set(GPIO3B2_SDMMC0DATA0_NAME, GPIO3B_SDMMC0_DATA0);
898 rk30_mux_api_set(GPIO3B3_SDMMC0DATA1_NAME, GPIO3B_SDMMC0_DATA1);
899 rk30_mux_api_set(GPIO3B4_SDMMC0DATA2_NAME, GPIO3B_SDMMC0_DATA2);
900 rk30_mux_api_set(GPIO3B5_SDMMC0DATA3_NAME, GPIO3B_SDMMC0_DATA3);
902 rk30_mux_api_set(GPIO3B6_SDMMC0DETECTN_NAME, GPIO3B_GPIO3B6);
904 rk30_mux_api_set(GPIO3A7_SDMMC0PWREN_NAME, GPIO3A_GPIO3A7);
905 gpio_request(RK30_PIN3_PA7, "sdmmc-power");
906 gpio_direction_output(RK30_PIN3_PA7, GPIO_LOW);
909 rk29_sdmmc_set_iomux(0, 0xFFFF);
911 #if defined(CONFIG_SDMMC0_RK29_SDCARD_DET_FROM_GPIO)
912 rk30_mux_api_set(GPIO3B6_SDMMC0DETECTN_NAME, GPIO3B_GPIO3B6);
914 rk30_mux_api_set(GPIO3B6_SDMMC0DETECTN_NAME, GPIO3B_SDMMC0_DETECT_N);
917 #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
918 gpio_request(SDMMC0_WRITE_PROTECT_PIN, "sdmmc-wp");
919 gpio_direction_input(SDMMC0_WRITE_PROTECT_PIN);
927 #define CONFIG_SDMMC0_USE_DMA
928 struct rk29_sdmmc_platform_data default_sdmmc0_data = {
930 (MMC_VDD_25_26 | MMC_VDD_26_27 | MMC_VDD_27_28 | MMC_VDD_28_29 |
931 MMC_VDD_29_30 | MMC_VDD_30_31 | MMC_VDD_31_32 | MMC_VDD_32_33 |
932 MMC_VDD_33_34 | MMC_VDD_34_35 | MMC_VDD_35_36),
934 (MMC_CAP_4_BIT_DATA | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
935 .io_init = rk29_sdmmc0_cfg_gpio,
937 #if !defined(CONFIG_SDMMC_RK29_OLD)
938 .set_iomux = rk29_sdmmc_set_iomux,
941 .dma_name = "sd_mmc",
942 #ifdef CONFIG_SDMMC0_USE_DMA
948 #if defined(CONFIG_WIFI_COMBO_MODULE_CONTROL_FUNC)
949 .status = rk29sdk_wifi_mmc0_status,
950 .register_status_notify = rk29sdk_wifi_mmc0_status_register,
952 #if defined(CONFIG_SDMMC0_RK29_SDCARD_DET_FROM_GPIO)
953 .detect_irq = RK29SDK_SD_CARD_DETECT_N,
954 .insert_card_level = RK29SDK_SD_CARD_INSERT_LEVEL,
956 .detect_irq = RK30_PIN3_PB6, // INVALID_GPIO
958 .enable_sd_wakeup = 0,
960 #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
961 .write_prt = SDMMC0_WRITE_PROTECT_PIN,
963 .write_prt = INVALID_GPIO,
966 #endif // CONFIG_SDMMC0_RK29
968 #ifdef CONFIG_SDMMC1_RK29
969 #define CONFIG_SDMMC1_USE_DMA
970 static int rk29_sdmmc1_cfg_gpio(void)
972 #if defined(CONFIG_SDMMC_RK29_OLD)
973 rk30_mux_api_set(GPIO3C0_SMMC1CMD_NAME, GPIO3C_SMMC1_CMD);
974 rk30_mux_api_set(GPIO3C5_SDMMC1CLKOUT_NAME, GPIO3C_SDMMC1_CLKOUT);
975 rk30_mux_api_set(GPIO3C1_SDMMC1DATA0_NAME, GPIO3C_SDMMC1_DATA0);
976 rk30_mux_api_set(GPIO3C2_SDMMC1DATA1_NAME, GPIO3C_SDMMC1_DATA1);
977 rk30_mux_api_set(GPIO3C3_SDMMC1DATA2_NAME, GPIO3C_SDMMC1_DATA2);
978 rk30_mux_api_set(GPIO3C4_SDMMC1DATA3_NAME, GPIO3C_SDMMC1_DATA3);
979 //rk30_mux_api_set(GPIO3C6_SDMMC1DETECTN_NAME, GPIO3C_SDMMC1_DETECT_N);
983 #if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
984 gpio_request(SDMMC1_WRITE_PROTECT_PIN, "sdio-wp");
985 gpio_direction_input(SDMMC1_WRITE_PROTECT_PIN);
993 struct rk29_sdmmc_platform_data default_sdmmc1_data = {
995 (MMC_VDD_25_26 | MMC_VDD_26_27 | MMC_VDD_27_28 | MMC_VDD_28_29 |
996 MMC_VDD_29_30 | MMC_VDD_30_31 | MMC_VDD_31_32 | MMC_VDD_32_33 |
999 #if !defined(CONFIG_USE_SDMMC1_FOR_WIFI_DEVELOP_BOARD)
1000 .host_caps = (MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ |
1001 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
1004 (MMC_CAP_4_BIT_DATA | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
1007 .io_init = rk29_sdmmc1_cfg_gpio,
1009 #if !defined(CONFIG_SDMMC_RK29_OLD)
1010 .set_iomux = rk29_sdmmc_set_iomux,
1014 #ifdef CONFIG_SDMMC1_USE_DMA
1020 #if !defined(CONFIG_USE_SDMMC1_FOR_WIFI_DEVELOP_BOARD)
1021 #if defined(CONFIG_WIFI_CONTROL_FUNC) || defined(CONFIG_WIFI_COMBO_MODULE_CONTROL_FUNC)
1022 .status = rk29sdk_wifi_status,
1023 .register_status_notify = rk29sdk_wifi_status_register,
1025 #if defined(CONFIG_SDMMC0_RK29_SDCARD_DET_FROM_GPIO)
1026 .detect_irq = INVALID_GPIO,//RK29SDK_WIFI_SDIO_CARD_DETECT_N,
1028 //.detect_irq = RK29SDK_WIFI_SDIO_CARD_DETECT_N,
1031 #if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
1032 .write_prt = SDMMC1_WRITE_PROTECT_PIN,
1034 .write_prt = INVALID_GPIO,
1037 #if defined(CONFIG_RK29_SDIO_IRQ_FROM_GPIO)
1038 .sdio_INT_gpio = RK29SDK_WIFI_SDIO_CARD_INT,
1042 .detect_irq = INVALID_GPIO,
1043 .enable_sd_wakeup = 0,
1047 #endif //endif--#ifdef CONFIG_SDMMC1_RK29
1049 /**************************************************************************************************
1050 * the end of setting for SDMMC devices
1051 **************************************************************************************************/
1053 #if defined(CONFIG_BATTERY_RK30_ADC)||defined(CONFIG_BATTERY_RK30_ADC_FAC)
1054 static struct rk30_adc_battery_platform_data rk30_adc_battery_platdata = {
1055 .dc_det_pin = RK30_PIN6_PA5,
1056 .batt_low_pin = RK30_PIN6_PA0,
1057 .charge_set_pin = INVALID_GPIO,
1058 .charge_ok_pin = RK30_PIN6_PA6,
1059 .dc_det_level = GPIO_LOW,
1060 .charge_ok_level = GPIO_HIGH,
1063 static struct platform_device rk30_device_adc_battery = {
1064 .name = "rk30-battery",
1067 .platform_data = &rk30_adc_battery_platdata,
1072 #ifdef CONFIG_RK30_PWM_REGULATOR
1073 const static int pwm_voltage_map[] = {
1074 1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000, 1375000, 1400000
1077 static struct regulator_consumer_supply pwm_dcdc1_consumers[] = {
1079 .supply = "vdd_core",
1083 struct regulator_init_data pwm_regulator_init_dcdc[1] =
1087 .name = "PWM_DCDC1",
1089 .max_uV = 1800000, //0.6-1.8V
1091 .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE,
1093 .num_consumer_supplies = ARRAY_SIZE(pwm_dcdc1_consumers),
1094 .consumer_supplies = pwm_dcdc1_consumers,
1098 static struct pwm_platform_data pwm_regulator_info[1] = {
1101 .pwm_gpio = RK30_PIN0_PD7,
1102 .pwm_iomux_name = GPIO0D7_PWM3_NAME,
1103 .pwm_iomux_pwm = GPIO0D_PWM3,
1104 .pwm_iomux_gpio = GPIO0D_GPIO0D6,
1105 .pwm_voltage = 1100000,
1106 .suspend_voltage = 1050000,
1109 .coefficient = 455, //45.5%
1110 .pwm_voltage_map = pwm_voltage_map,
1111 .init_data = &pwm_regulator_init_dcdc[0],
1115 struct platform_device pwm_regulator_device[1] = {
1117 .name = "pwm-voltage-regulator",
1120 .platform_data = &pwm_regulator_info[0],
1126 #ifdef CONFIG_RK29_VMAC
1127 #define PHY_PWR_EN_GPIO RK30_PIN1_PD6
1128 #include "board-rk30-sdk-vmac.c"
1131 #ifdef CONFIG_RFKILL_RK
1132 // bluetooth rfkill device, its driver in net/rfkill/rfkill-rk.c
1133 static struct rfkill_rk_platform_data rfkill_rk_platdata = {
1134 .type = RFKILL_TYPE_BLUETOOTH,
1136 .poweron_gpio = { // BT_REG_ON
1137 .io = RK30_PIN3_PC7,
1138 .enable = GPIO_HIGH,
1140 .name = GPIO3C7_SDMMC1WRITEPRT_NAME,
1141 .fgpio = GPIO3C_GPIO3C7,
1145 .reset_gpio = { // BT_RST
1146 .io = RK30_PIN3_PD1, // set io to INVALID_GPIO for disable it
1149 .name = GPIO3D1_SDMMC1BACKENDPWR_NAME,
1150 .fgpio = GPIO3D_GPIO3D1,
1154 .wake_gpio = { // BT_WAKE, use to control bt's sleep and wakeup
1155 .io = RK30_PIN3_PC6, // set io to INVALID_GPIO for disable it
1156 .enable = GPIO_HIGH,
1158 .name = GPIO3C6_SDMMC1DETECTN_NAME,
1159 .fgpio = GPIO3C_GPIO3C6,
1163 .wake_host_irq = { // BT_HOST_WAKE, for bt wakeup host when it is in deep sleep
1165 .io = RK30_PIN6_PA7, // set io to INVALID_GPIO for disable it
1166 .enable = GPIO_LOW, // set GPIO_LOW for falling, set 0 for rising
1173 .rts_gpio = { // UART_RTS, enable or disable BT's data coming
1174 .io = RK30_PIN1_PA3, // set io to INVALID_GPIO for disable it
1177 .name = GPIO1A3_UART0RTSN_NAME,
1178 .fgpio = GPIO1A_GPIO1A3,
1179 .fmux = GPIO1A_UART0_RTS_N,
1184 static struct platform_device device_rfkill_rk = {
1185 .name = "rfkill_rk",
1188 .platform_data = &rfkill_rk_platdata,
1193 static struct platform_device *devices[] __initdata = {
1194 #ifdef CONFIG_FB_ROCKCHIP
1197 #if defined(CONFIG_LCDC0_RK30)
1200 #if defined(CONFIG_LCDC1_RK30)
1204 #ifdef CONFIG_BACKLIGHT_RK29_BL
1205 &rk29_device_backlight,
1211 #ifdef CONFIG_ANDROID_TIMED_GPIO
1212 &rk29_device_vibrator,
1214 #ifdef CONFIG_LEDS_GPIO_PLATFORM
1215 &rk29_device_gpio_leds,
1217 #ifdef CONFIG_RK_IRDA
1220 #if defined(CONFIG_WIFI_CONTROL_FUNC)||defined(CONFIG_WIFI_COMBO_MODULE_CONTROL_FUNC)
1221 &rk29sdk_wifi_device,
1224 #if defined(CONFIG_MT6620)
1228 #ifdef CONFIG_RK29_SUPPORT_MODEM
1231 #if defined(CONFIG_MU509)
1234 #if defined(CONFIG_MW100)
1237 #if defined(CONFIG_MT6229)
1238 &rk29_device_mt6229,
1240 #if defined(CONFIG_SEW868)
1241 &rk30_device_sew868,
1243 #if defined(CONFIG_BATTERY_RK30_ADC)||defined(CONFIG_BATTERY_RK30_ADC_FAC)
1244 &rk30_device_adc_battery,
1246 #ifdef CONFIG_RFKILL_RK
1252 #ifdef CONFIG_I2C0_RK30
1253 static struct i2c_board_info __initdata i2c0_info[] = {
1254 #if defined (CONFIG_GS_MMA8452)
1256 .type = "gs_mma8452",
1259 .irq = MMA8452_INT_PIN,
1260 .platform_data = &mma8452_info,
1263 #if defined (CONFIG_GS_LIS3DH)
1265 .type = "gs_lis3dh",
1266 .addr = 0x19, //0x19(SA0-->VCC), 0x18(SA0-->GND)
1268 .irq = LIS3DH_INT_PIN,
1269 .platform_data = &lis3dh_info,
1272 #if defined (CONFIG_GS_KXTIK)
1277 .irq = KXTIK_INT_PIN,
1278 .platform_data = &kxtik_info,
1281 #if defined (CONFIG_COMPASS_AK8975)
1286 .irq = RK30_PIN4_PC1,
1287 .platform_data = &akm8975_info,
1290 #if defined (CONFIG_GYRO_L3G4200D)
1292 .type = "l3g4200d_gryo",
1295 .irq = L3G4200D_INT_PIN,
1296 .platform_data = &l3g4200d_info,
1299 #if defined (CONFIG_LS_AL3006)
1301 .type = "light_al3006",
1302 .addr = 0x1c, //sel = 0; if sel =1, then addr = 0x1D
1304 .irq = RK30_PIN6_PA2,
1305 .platform_data = &light_al3006_info,
1308 #if defined (CONFIG_LS_STK3171)
1310 .type = "ls_stk3171",
1313 .irq = RK30_PIN6_PA2,
1314 .platform_data = &light_stk3171_info,
1319 #if defined (CONFIG_PS_AL3006)
1321 .type = "proximity_al3006",
1322 .addr = 0x1c, //sel = 0; if sel =1, then addr = 0x1D
1324 .irq = RK30_PIN6_PA2,
1325 .platform_data = &proximity_al3006_info,
1329 #if defined (CONFIG_PS_STK3171)
1331 .type = "ps_stk3171",
1334 .irq = RK30_PIN6_PA2,
1335 .platform_data = &proximity_stk3171_info,
1338 #if defined (CONFIG_SND_SOC_RK1000)
1340 .type = "rk1000_i2c_codec",
1345 .type = "rk1000_control",
1350 #if defined (CONFIG_SND_SOC_RT5631)
1358 #ifdef CONFIG_MFD_RK610
1360 .type = "rk610_ctl",
1363 .platform_data = &rk610_power_on_init,
1365 #ifdef CONFIG_RK610_TVOUT
1367 .type = "rk610_tvout",
1372 #ifdef CONFIG_RK610_HDMI
1374 .type = "rk610_hdmi",
1377 .irq = RK29_PIN5_PA2,
1380 #ifdef CONFIG_SND_SOC_RK610
1381 {//RK610_CODEC addr from 0x60 to 0x80 (0x60~0x80)
1382 .type = "rk610_i2c_codec",
1391 int __sramdata g_pmic_type = 0;
1392 #ifdef CONFIG_I2C1_RK30
1393 #ifdef CONFIG_MFD_WM831X_I2C
1394 #include "board-rk30-sdk-wm8326.c"
1396 #ifdef CONFIG_MFD_TPS65910
1397 #define TPS65910_HOST_IRQ RK30_PIN6_PA4
1398 #include "board-rk30-sdk-tps65910.c"
1401 static struct i2c_board_info __initdata i2c1_info[] = {
1402 #if defined (CONFIG_MFD_WM831X_I2C)
1407 .irq = RK30_PIN6_PA4,
1408 .platform_data = &wm831x_platdata,
1411 #if defined (CONFIG_MFD_TPS65910)
1414 .addr = TPS65910_I2C_ID0,
1416 .irq = TPS65910_HOST_IRQ,
1417 .platform_data = &tps65910_data,
1423 void __sramfunc board_pmu_suspend(void)
1425 #if defined (CONFIG_MFD_WM831X_I2C)
1426 if(pmic_is_wm8326())
1427 board_pmu_wm8326_suspend();
1429 #if defined (CONFIG_MFD_TPS65910)
1430 if(pmic_is_tps65910())
1431 board_pmu_tps65910_suspend();
1435 void __sramfunc board_pmu_resume(void)
1437 #if defined (CONFIG_MFD_WM831X_I2C)
1438 if(pmic_is_wm8326())
1439 board_pmu_wm8326_resume();
1441 #if defined (CONFIG_MFD_TPS65910)
1442 if(pmic_is_tps65910())
1443 board_pmu_tps65910_resume();
1447 #ifdef CONFIG_I2C2_RK30
1448 static struct i2c_board_info __initdata i2c2_info[] = {
1449 #if defined (CONFIG_TOUCHSCREEN_GT8XX)
1451 .type = "Goodix-TS",
1454 .irq = RK30_PIN4_PC2,
1455 .platform_data = &goodix_info,
1458 #if defined (CONFIG_LS_CM3217)
1460 .type = "light_cm3217",
1463 .platform_data = &cm3217_info,
1469 #ifdef CONFIG_I2C3_RK30
1470 static struct i2c_board_info __initdata i2c3_info[] = {
1474 #ifdef CONFIG_I2C4_RK30
1475 static struct i2c_board_info __initdata i2c4_info[] = {
1479 #ifdef CONFIG_I2C_GPIO_RK30
1480 #define I2C_SDA_PIN INVALID_GPIO// RK30_PIN2_PD6 //set sda_pin here
1481 #define I2C_SCL_PIN INVALID_GPIO//RK30_PIN2_PD7 //set scl_pin here
1482 static int rk30_i2c_io_init(void)
1484 //set iomux (gpio) here
1485 //rk30_mux_api_set(GPIO2D7_I2C1SCL_NAME, GPIO2D_GPIO2D7);
1486 //rk30_mux_api_set(GPIO2D6_I2C1SDA_NAME, GPIO2D_GPIO2D6);
1490 struct i2c_gpio_platform_data default_i2c_gpio_data = {
1491 .sda_pin = I2C_SDA_PIN,
1492 .scl_pin = I2C_SCL_PIN,
1493 .udelay = 5, // clk = 500/udelay = 100Khz
1494 .timeout = 100,//msecs_to_jiffies(100),
1496 .io_init = rk30_i2c_io_init,
1498 static struct i2c_board_info __initdata i2c_gpio_info[] = {
1502 static void __init rk30_i2c_register_board_info(void)
1504 #ifdef CONFIG_I2C0_RK30
1505 i2c_register_board_info(0, i2c0_info, ARRAY_SIZE(i2c0_info));
1507 #ifdef CONFIG_I2C1_RK30
1508 i2c_register_board_info(1, i2c1_info, ARRAY_SIZE(i2c1_info));
1510 #ifdef CONFIG_I2C2_RK30
1511 i2c_register_board_info(2, i2c2_info, ARRAY_SIZE(i2c2_info));
1513 #ifdef CONFIG_I2C3_RK30
1514 i2c_register_board_info(3, i2c3_info, ARRAY_SIZE(i2c3_info));
1516 #ifdef CONFIG_I2C4_RK30
1517 i2c_register_board_info(4, i2c4_info, ARRAY_SIZE(i2c4_info));
1519 #ifdef CONFIG_I2C_GPIO_RK30
1520 i2c_register_board_info(5, i2c_gpio_info, ARRAY_SIZE(i2c_gpio_info));
1525 #define POWER_ON_PIN RK30_PIN6_PB0 //power_hold
1526 static void rk30_pm_power_off(void)
1528 printk(KERN_ERR "rk30_pm_power_off start...\n");
1529 gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
1530 #if defined(CONFIG_MFD_WM831X)
1531 if(pmic_is_wm8326())
1533 wm831x_set_bits(Wm831x,WM831X_GPIO_LEVEL,0x0001,0x0000); //set sys_pwr 0
1534 wm831x_device_shutdown(Wm831x);//wm8326 shutdown
1537 #if defined(CONFIG_MFD_TPS65910)
1538 if(pmic_is_tps65910())
1540 tps65910_device_shutdown();//tps65910 shutdown
1547 static void __init machine_rk30_board_init(void)
1550 gpio_request(POWER_ON_PIN, "poweronpin");
1551 gpio_direction_output(POWER_ON_PIN, GPIO_HIGH);
1553 pm_power_off = rk30_pm_power_off;
1555 rk30_i2c_register_board_info();
1556 spi_register_board_info(board_spi_devices, ARRAY_SIZE(board_spi_devices));
1557 platform_add_devices(devices, ARRAY_SIZE(devices));
1558 board_usb_detect_init(RK30_PIN6_PA3);
1560 #ifdef CONFIG_WIFI_CONTROL_FUNC
1561 rk29sdk_wifi_bt_gpio_control_init();
1564 #if defined(CONFIG_MT6620)
1565 clk_set_rate(clk_get_sys("rk_serial.0", "uart"), 16*1000000);
1569 static void __init rk30_reserve(void)
1572 rk30_ion_pdata.heaps[0].base = board_mem_reserve_add("ion", ION_RESERVE_SIZE);
1574 #ifdef CONFIG_FB_ROCKCHIP
1575 resource_fb[0].start = board_mem_reserve_add("fb0", RK30_FB0_MEM_SIZE);
1576 resource_fb[0].end = resource_fb[0].start + RK30_FB0_MEM_SIZE - 1;
1578 resource_fb[1].start = board_mem_reserve_add("ipp buf", RK30_FB0_MEM_SIZE);
1579 resource_fb[1].end = resource_fb[1].start + RK30_FB0_MEM_SIZE - 1;
1580 resource_fb[2].start = board_mem_reserve_add("fb2", RK30_FB0_MEM_SIZE);
1581 resource_fb[2].end = resource_fb[2].start + RK30_FB0_MEM_SIZE - 1;
1584 #ifdef CONFIG_VIDEO_RK29
1585 rk30_camera_request_reserve_mem();
1587 board_mem_reserved();
1591 * dvfs_cpu_logic_table: table for arm and logic dvfs
1592 * @frequency : arm frequency
1593 * @cpu_volt : arm voltage depend on frequency
1594 * @logic_volt : logic voltage arm requests depend on frequency
1595 * comments : min arm/logic voltage
1597 static struct dvfs_arm_table dvfs_cpu_logic_table[] = {
1598 {.frequency = 252 * 1000, .cpu_volt = 1075 * 1000, .logic_volt = 1125 * 1000},//0.975V/1.000V
1599 {.frequency = 504 * 1000, .cpu_volt = 1100 * 1000, .logic_volt = 1125 * 1000},//0.975V/1.000V
1600 {.frequency = 816 * 1000, .cpu_volt = 1125 * 1000, .logic_volt = 1150 * 1000},//1.000V/1.025V
1601 {.frequency = 1008 * 1000, .cpu_volt = 1125 * 1000, .logic_volt = 1150 * 1000},//1.025V/1.050V
1602 {.frequency = 1200 * 1000, .cpu_volt = 1175 * 1000, .logic_volt = 1200 * 1000},//1.100V/1.050V
1603 {.frequency = 1272 * 1000, .cpu_volt = 1225 * 1000, .logic_volt = 1200 * 1000},//1.150V/1.100V
1604 {.frequency = 1416 * 1000, .cpu_volt = 1300 * 1000, .logic_volt = 1200 * 1000},//1.225V/1.100V
1605 {.frequency = 1512 * 1000, .cpu_volt = 1350 * 1000, .logic_volt = 1250 * 1000},//1.300V/1.150V
1606 {.frequency = 1608 * 1000, .cpu_volt = 1425 * 1000, .logic_volt = 1300 * 1000},//1.325V/1.175V
1607 {.frequency = CPUFREQ_TABLE_END},
1610 static struct cpufreq_frequency_table dvfs_gpu_table[] = {
1611 {.frequency = 266 * 1000, .index = 1050 * 1000},
1612 {.frequency = 400 * 1000, .index = 1275 * 1000},
1613 {.frequency = CPUFREQ_TABLE_END},
1616 static struct cpufreq_frequency_table dvfs_ddr_table[] = {
1617 {.frequency = 300 * 1000, .index = 1050 * 1000},
1618 {.frequency = 400 * 1000, .index = 1125 * 1000},
1619 {.frequency = CPUFREQ_TABLE_END},
1622 #define DVFS_CPU_TABLE_SIZE (ARRAY_SIZE(dvfs_cpu_logic_table))
1623 static struct cpufreq_frequency_table cpu_dvfs_table[DVFS_CPU_TABLE_SIZE];
1624 static struct cpufreq_frequency_table dep_cpu2core_table[DVFS_CPU_TABLE_SIZE];
1626 void __init board_clock_init(void)
1628 rk30_clock_data_init(periph_pll_default, codec_pll_default, RK30_CLOCKS_DEFAULT_FLAGS);
1629 dvfs_set_arm_logic_volt(dvfs_cpu_logic_table, cpu_dvfs_table, dep_cpu2core_table);
1630 dvfs_set_freq_volt_table(clk_get(NULL, "gpu"), dvfs_gpu_table);
1631 dvfs_set_freq_volt_table(clk_get(NULL, "ddr"), dvfs_ddr_table);
1634 MACHINE_START(RK30, "RK30board")
1635 .boot_params = PLAT_PHYS_OFFSET + 0x800,
1636 .fixup = rk30_fixup,
1637 .reserve = &rk30_reserve,
1638 .map_io = rk30_map_io,
1639 .init_irq = rk30_init_irq,
1640 .timer = &rk30_timer,
1641 .init_machine = machine_rk30_board_init,