1 /* arch/arm/mach-rk2928/board-rk2928-fpga.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>
30 #include <asm/setup.h>
31 #include <asm/mach-types.h>
32 #include <asm/mach/arch.h>
33 #include <asm/mach/map.h>
34 #include <asm/mach/flash.h>
35 #include <asm/hardware/gic.h>
36 #include <mach/dvfs.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/mfd/tps65910.h>
48 #include <linux/regulator/act8931.h>
49 #include <linux/regulator/rk29-pwm-regulator.h>
50 #if defined(CONFIG_HDMI_RK30)
51 #include "../../../drivers/video/rockchip/hdmi/rk_hdmi.h"
54 #if defined(CONFIG_SPIM_RK29)
55 #include "../../../drivers/spi/rk29_spim.h"
58 #include "board-rk2928-a720-camera.c"
59 #include "board-rk2928-a720-key.c"
61 int __sramdata g_pmic_type = 0;
62 #define PMIC_TYPE_TPS65910 2
63 #define PMIC_TYPE_ACT8931 3
65 #ifdef CONFIG_THREE_FB_BUFFER
66 #define RK30_FB0_MEM_SIZE 12*SZ_1M
68 #define RK30_FB0_MEM_SIZE 8*SZ_1M
71 static struct spi_board_info board_spi_devices[] = {
74 /***********************************************************
76 ************************************************************/
77 #ifdef CONFIG_BACKLIGHT_RK29_BL
79 #define PWM_MUX_NAME GPIO0D2_PWM_0_NAME
80 #define PWM_MUX_MODE GPIO0D_PWM_0
81 #define PWM_MUX_MODE_GPIO GPIO0D_GPIO0D2
82 #define PWM_GPIO RK2928_PIN0_PD2
83 #define PWM_EFFECT_VALUE 0
85 #if defined(CONFIG_MACH_RK2926_M713)
86 //#define LCD_DISP_ON_PIN
88 #define LCD_DISP_ON_PIN
91 #ifdef LCD_DISP_ON_PIN
93 #define BL_EN_PIN RK2928_PIN1_PB0
94 #define BL_EN_VALUE GPIO_HIGH
96 static int rk29_backlight_io_init(void)
99 rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
100 #ifdef LCD_DISP_ON_PIN
101 // rk30_mux_api_set(BL_EN_MUX_NAME, BL_EN_MUX_MODE);
103 ret = gpio_request(BL_EN_PIN, NULL);
105 gpio_free(BL_EN_PIN);
108 gpio_direction_output(BL_EN_PIN, 0);
109 gpio_set_value(BL_EN_PIN, BL_EN_VALUE);
114 static int rk29_backlight_io_deinit(void)
117 #ifdef LCD_DISP_ON_PIN
118 gpio_set_value(BL_EN_PIN, !BL_EN_VALUE);
119 gpio_free(BL_EN_PIN);
121 rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE_GPIO);
125 static int rk29_backlight_pwm_suspend(void)
128 rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE_GPIO);
129 if (gpio_request(PWM_GPIO, NULL)) {
130 printk("func %s, line %d: request gpio fail\n", __FUNCTION__, __LINE__);
133 #if defined(CONFIG_MFD_TPS65910)
134 if(g_pmic_type == PMIC_TYPE_TPS65910)
136 gpio_direction_output(PWM_GPIO, GPIO_LOW);
139 #if defined(CONFIG_REGULATOR_ACT8931)
140 if(g_pmic_type == PMIC_TYPE_ACT8931)
142 gpio_direction_output(PWM_GPIO, GPIO_HIGH);
145 #ifdef LCD_DISP_ON_PIN
146 gpio_direction_output(BL_EN_PIN, 0);
147 gpio_set_value(BL_EN_PIN, !BL_EN_VALUE);
153 static int rk29_backlight_pwm_resume(void)
156 rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
157 #ifdef LCD_DISP_ON_PIN
159 gpio_direction_output(BL_EN_PIN, 1);
160 gpio_set_value(BL_EN_PIN, BL_EN_VALUE);
165 static struct rk29_bl_info rk29_bl_info = {
167 .min_brightness = 80,
168 .bl_ref = PWM_EFFECT_VALUE,
169 .io_init = rk29_backlight_io_init,
170 .io_deinit = rk29_backlight_io_deinit,
171 .pwm_suspend = rk29_backlight_pwm_suspend,
172 .pwm_resume = rk29_backlight_pwm_resume,
175 static struct platform_device rk29_device_backlight = {
176 .name = "rk29_backlight",
179 .platform_data = &rk29_bl_info,
185 #ifdef CONFIG_FB_ROCKCHIP
187 #define LCD_MUX_NAME GPIO0C2_UART0_RTSN_NAME
188 #define LCD_GPIO_MODE GPIO0C_GPIO0C2
190 #ifdef CONFIG_MACH_RK2926_M713
191 #define LCD_EN RK2928_PIN1_PB3
193 #define LCD_EN RK2928_PIN0_PC2
195 #define LCD_EN_VALUE GPIO_LOW
197 static int rk_fb_io_init(struct rk29_fb_setting_info *fb_setting)
201 rk30_mux_api_set(LCD_MUX_NAME, LCD_GPIO_MODE);
203 ret = gpio_request(LCD_EN, NULL);
207 printk(KERN_ERR "request lcd en pin fail!\n");
212 gpio_direction_output(LCD_EN, LCD_EN_VALUE); //disable
216 static int rk_fb_io_disable(void)
219 #if 0//defined(CONFIG_REGULATOR_ACT8931)
220 if(g_pmic_type == PMIC_TYPE_ACT8931)
222 struct regulator *ldo;
223 ldo = regulator_get(NULL, "act_ldo4"); //vcc_lcd
224 regulator_disable(ldo);
229 gpio_set_value(LCD_EN, !LCD_EN_VALUE);
232 static int rk_fb_io_enable(void)
234 #if 0//defined(CONFIG_REGULATOR_ACT8931)
235 if(g_pmic_type == PMIC_TYPE_ACT8931)
237 struct regulator *ldo;
238 ldo = regulator_get(NULL, "act_ldo4"); //vcc_lcd
239 regulator_enable(ldo);
242 msleep(300); // wait for powering on LED circuit
246 gpio_set_value(LCD_EN, LCD_EN_VALUE);
250 #if defined(CONFIG_LCDC_RK2928)
251 struct rk29fb_info lcdc_screen_info = {
252 .prop = PRMRY, //primary display device
253 .io_init = rk_fb_io_init,
254 .io_disable = rk_fb_io_disable,
255 .io_enable = rk_fb_io_enable,
256 .set_screen_info = set_lcd_info,
260 static struct resource resource_fb[] = {
264 .end = 0,//RK30_FB0_MEM_SIZE - 1,
265 .flags = IORESOURCE_MEM,
268 .name = "ipp buf", //for rotate
270 .end = 0,//RK30_FB0_MEM_SIZE - 1,
271 .flags = IORESOURCE_MEM,
276 .end = 0,//RK30_FB0_MEM_SIZE - 1,
277 .flags = IORESOURCE_MEM,
281 static struct platform_device device_fb = {
284 .num_resources = ARRAY_SIZE(resource_fb),
285 .resource = resource_fb,
290 #ifdef CONFIG_LCDC_RK2928
291 static struct resource resource_lcdc[] = {
294 .start = RK2928_LCDC_PHYS,
295 .end = RK2928_LCDC_PHYS + RK2928_LCDC_SIZE - 1,
296 .flags = IORESOURCE_MEM,
303 .flags = IORESOURCE_IRQ,
307 static struct platform_device device_lcdc = {
308 .name = "rk2928-lcdc",
310 .num_resources = ARRAY_SIZE(resource_lcdc),
311 .resource = resource_lcdc,
313 .platform_data = &lcdc_screen_info,
319 #define ION_RESERVE_SIZE (80 * SZ_1M)
320 static struct ion_platform_data rk30_ion_pdata = {
324 .type = ION_HEAP_TYPE_CARVEOUT,
325 .id = ION_NOR_HEAP_ID,
327 .size = ION_RESERVE_SIZE,
332 static struct platform_device device_ion = {
333 .name = "ion-rockchip",
336 .platform_data = &rk30_ion_pdata,
342 #if defined(CONFIG_TOUCHSCREEN_SITRONIX_A720)
344 #define TOUCH_RESET_PIN RK2928_PIN1_PA3
345 #ifdef CONFIG_MACH_RK2926_M713
346 #define TOUCH_INT_PIN RK2928_PIN1_PB0
348 #define TOUCH_INT_PIN RK2928_PIN1_PB3
350 int ft5306_init_platform_hw(void)
353 //printk("ft5306_init_platform_hw\n");
354 if(gpio_request(TOUCH_RESET_PIN,NULL) != 0){
355 gpio_free(TOUCH_RESET_PIN);
356 printk("ft5306_init_platform_hw gpio_request error\n");
360 if(gpio_request(TOUCH_INT_PIN,NULL) != 0){
361 gpio_free(TOUCH_INT_PIN);
362 printk("ift5306_init_platform_hw gpio_request error\n");
365 gpio_direction_output(TOUCH_RESET_PIN, GPIO_HIGH);
367 gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
369 gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
375 struct ft5x0x_platform_data sitronix_info = {
377 .init_platform_hw= ft5306_init_platform_hw,
384 #if defined (CONFIG_GS_MMA7660)
385 #ifdef CONFIG_MACH_RK2926_M713
386 #define MMA7660_INT_PIN RK2928_PIN1_PB2
388 #define MMA7660_INT_PIN RK2928_PIN1_PB1
391 static int mma7660_init_platform_hw(void)
393 #ifdef CONFIG_MACH_RK2926_M713
394 rk30_mux_api_set(GPIO1B2_SPI_RXD_UART1_SIN_NAME, GPIO1B_GPIO1B2);
396 rk30_mux_api_set(GPIO1B1_SPI_TXD_UART1_SOUT_NAME, GPIO1B_GPIO1B1);
402 static struct sensor_platform_data mma7660_info = {
403 .type = SENSOR_TYPE_ACCEL,
406 .init_platform_hw = mma7660_init_platform_hw,
407 .orientation = {-1, 0, 0, 0, 0, -1, 0, 1, 0},
412 #if CONFIG_RK30_PWM_REGULATOR
413 static int pwm_voltage_map[] = {
414 1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000, 1375000, 1400000
417 static struct regulator_consumer_supply pwm_dcdc1_consumers[] = {
419 .supply = "vdd_core",
423 struct regulator_init_data pwm_regulator_init_dcdc[1] =
429 .max_uV = 1800000, //0.6-1.8V
431 .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE,
433 .num_consumer_supplies = ARRAY_SIZE(pwm_dcdc1_consumers),
434 .consumer_supplies = pwm_dcdc1_consumers,
438 static struct pwm_platform_data pwm_regulator_info[1] = {
441 .pwm_gpio = RK2928_PIN0_PD4,
442 .pwm_iomux_name = GPIO0D4_PWM_2_NAME,
443 .pwm_iomux_pwm = GPIO0D_PWM_2,
444 .pwm_iomux_gpio = GPIO0D_GPIO0D4,
445 .pwm_voltage = 1200000,
446 .suspend_voltage = 1050000,
449 .coefficient = 455, //45.5%
450 .pwm_voltage_map = pwm_voltage_map,
451 .init_data = &pwm_regulator_init_dcdc[0],
455 struct platform_device pwm_regulator_device[1] = {
457 .name = "pwm-voltage-regulator",
460 .platform_data = &pwm_regulator_info[0],
466 /***********************************************************
468 ************************************************************/
469 #if defined(CONFIG_RTL8192CU) || defined(CONFIG_RTL8188EU)
471 static void rkusb_wifi_power(int on) {
472 struct regulator *ldo = NULL;
474 #if defined(CONFIG_MFD_TPS65910)
475 if(g_pmic_type == PMIC_TYPE_TPS65910) {
476 ldo = regulator_get(NULL, "vmmc"); //vccio_wl
479 #if defined(CONFIG_REGULATOR_ACT8931)
480 if(g_pmic_type == PMIC_TYPE_ACT8931) {
481 ldo = regulator_get(NULL, "act_ldo4"); //vccio_wl
486 regulator_enable(ldo);
487 printk("%s: vccio_wl enable\n", __func__);
489 printk("%s: vccio_wl disable\n", __func__);
490 regulator_disable(ldo);
499 /**************************************************************************************************
500 * SDMMC devices, include the module of SD,MMC,and sdio.noted by xbw at 2012-03-05
501 **************************************************************************************************/
502 #ifdef CONFIG_SDMMC_RK29
503 #include "board-rk2928-sdk-sdmmc.c"
505 #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
506 #define SDMMC0_WRITE_PROTECT_PIN RK2928_PIN1_PA7 //According to your own project to set the value of write-protect-pin.
509 #if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
510 #define SDMMC1_WRITE_PROTECT_PIN RK2928_PIN0_PD5 //According to your own project to set the value of write-protect-pin.
513 #define RK29SDK_WIFI_SDIO_CARD_DETECT_N RK2928_PIN0_PB2
515 #endif //endif ---#ifdef CONFIG_SDMMC_RK29
517 #ifdef CONFIG_SDMMC0_RK29
518 static int rk29_sdmmc0_cfg_gpio(void)
520 rk29_sdmmc_set_iomux(0, 0xFFFF);
522 rk30_mux_api_set(GPIO1C1_MMC0_DETN_NAME, GPIO1C_MMC0_DETN);
524 #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
525 gpio_request(SDMMC0_WRITE_PROTECT_PIN, "sdmmc-wp");
526 gpio_direction_input(SDMMC0_WRITE_PROTECT_PIN);
532 #define CONFIG_SDMMC0_USE_DMA
533 struct rk29_sdmmc_platform_data default_sdmmc0_data = {
535 (MMC_VDD_25_26 | MMC_VDD_26_27 | MMC_VDD_27_28 | MMC_VDD_28_29 |
536 MMC_VDD_29_30 | MMC_VDD_30_31 | MMC_VDD_31_32 | MMC_VDD_32_33 |
537 MMC_VDD_33_34 | MMC_VDD_34_35 | MMC_VDD_35_36),
539 (MMC_CAP_4_BIT_DATA | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
540 .io_init = rk29_sdmmc0_cfg_gpio,
542 #if !defined(CONFIG_SDMMC_RK29_OLD)
543 .set_iomux = rk29_sdmmc_set_iomux,
546 .dma_name = "sd_mmc",
547 #ifdef CONFIG_SDMMC0_USE_DMA
552 .detect_irq = RK2928_PIN1_PC1, // INVALID_GPIO
553 .enable_sd_wakeup = 0,
555 #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
556 .write_prt = SDMMC0_WRITE_PROTECT_PIN,
558 .write_prt = INVALID_GPIO,
561 #endif // CONFIG_SDMMC0_RK29
563 #ifdef CONFIG_SND_SOC_RK2928
564 static struct resource resources_acodec[] = {
566 .start = RK2928_ACODEC_PHYS,
567 .end = RK2928_ACODEC_PHYS + RK2928_ACODEC_SIZE - 1,
568 .flags = IORESOURCE_MEM,
571 .start = RK2928_PIN1_PA0,
572 .end = RK2928_PIN1_PA0,
573 .flags = IORESOURCE_IO,
577 static struct platform_device device_acodec = {
578 .name = "rk2928-codec",
580 .num_resources = ARRAY_SIZE(resources_acodec),
581 .resource = resources_acodec,
585 static struct platform_device *devices[] __initdata = {
586 #ifdef CONFIG_FB_ROCKCHIP
589 #ifdef CONFIG_LCDC_RK2928
592 #ifdef CONFIG_BACKLIGHT_RK29_BL
593 &rk29_device_backlight,
598 #ifdef CONFIG_SND_SOC_RK2928
603 #ifdef CONFIG_I2C0_RK30
604 #ifdef CONFIG_MFD_TPS65910
605 #define TPS65910_HOST_IRQ RK2928_PIN1_PB2
606 #include "board-rk2928-a720-tps65910.c"
608 #ifdef CONFIG_REGULATOR_ACT8931
609 #ifdef CONFIG_MACH_RK2926_M713
610 #define ACT8931_HOST_IRQ RK2928_PIN1_PB1
612 #define ACT8931_HOST_IRQ RK2928_PIN1_PB2
614 #include "board-rk2928-sdk-act8931.c"
617 static struct i2c_board_info __initdata i2c0_info[] = {
618 #if defined (CONFIG_MFD_TPS65910)
621 .addr = TPS65910_I2C_ID0,
623 .irq = TPS65910_HOST_IRQ,
624 .platform_data = &tps65910_data,
627 #if defined (CONFIG_REGULATOR_ACT8931)
632 .irq = ACT8931_HOST_IRQ,
633 .platform_data=&act8931_data,
636 #ifdef CONFIG_MACH_RK2926_M713
637 #if defined (CONFIG_RTC_HYM8563)
639 .type = "rtc_hym8563",
642 .irq = RK2928_PIN1_PA5,
649 int __sramdata gpio0d4_iomux,gpio0d4_do,gpio0d4_dir;
652 #define gpio_readl(offset) readl_relaxed(RK2928_GPIO0_BASE + offset)
653 #define gpio_writel(v, offset) do { writel_relaxed(v, RK2928_GPIO0_BASE + offset); dsb(); } while (0)
656 void __sramfunc rk30_pwm_logic_suspend_voltage(void)
658 #ifdef CONFIG_RK30_PWM_REGULATOR
660 // int gpio0d7_iomux,gpio0d7_do,gpio0d7_dir,gpio0d7_en;
662 gpio0d4_iomux = readl_relaxed(GRF_GPIO0D_IOMUX);
663 gpio0d4_do = gpio_readl(GPIO_SWPORTA_DR);
664 gpio0d4_dir = gpio_readl(GPIO_SWPORTA_DDR);
666 writel_relaxed((gpio0d4_iomux |(1<<24)) & (~(1<<8)), GRF_GPIO0D_IOMUX);
667 gpio_writel(gpio0d4_dir |(1<<28), GPIO_SWPORTA_DDR);
668 gpio_writel(gpio0d4_do |(1<<28), GPIO_SWPORTA_DR);
672 void __sramfunc rk30_pwm_logic_resume_voltage(void)
674 #ifdef CONFIG_RK30_PWM_REGULATOR
675 writel_relaxed((1<<24)|gpio0d4_iomux, GRF_GPIO0D_IOMUX);
676 gpio_writel(gpio0d4_dir, GPIO_SWPORTA_DDR);
677 gpio_writel(gpio0d4_do, GPIO_SWPORTA_DR);
683 extern void pwm_suspend_voltage(void);
684 extern void pwm_resume_voltage(void);
685 void rk30_pwm_suspend_voltage_set(void)
687 #ifdef CONFIG_RK30_PWM_REGULATOR
688 pwm_suspend_voltage();
691 void rk30_pwm_resume_voltage_set(void)
693 #ifdef CONFIG_RK30_PWM_REGULATOR
694 pwm_resume_voltage();
698 #ifdef CONFIG_I2C1_RK30
699 static struct i2c_board_info __initdata i2c1_info[] = {
700 #if defined (CONFIG_GS_MMA7660)
702 .type = "gs_mma7660",
705 .irq = MMA7660_INT_PIN,
706 .platform_data = &mma7660_info,
712 #ifdef CONFIG_I2C2_RK30
713 static struct i2c_board_info __initdata i2c2_info[] = {
714 #if defined (CONFIG_TOUCHSCREEN_SITRONIX_A720)
717 #ifdef CONFIG_MACH_RK2926_M713
723 .irq = TOUCH_INT_PIN,
724 .platform_data = &sitronix_info,
729 #ifdef CONFIG_I2C3_RK30
730 static struct i2c_board_info __initdata i2c3_info[] = {
733 #ifdef CONFIG_I2C_GPIO_RK30
734 #define I2C_SDA_PIN INVALID_GPIO //set sda_pin here
735 #define I2C_SCL_PIN INVALID_GPIO //set scl_pin here
736 static int rk30_i2c_io_init(void)
738 //set iomux (gpio) here
742 struct i2c_gpio_platform_data default_i2c_gpio_data = {
743 .sda_pin = I2C_SDA_PIN,
744 .scl_pin = I2C_SCL_PIN,
745 .udelay = 5, // clk = 500/udelay = 100Khz
746 .timeout = 100,//msecs_to_jiffies(100),
748 .io_init = rk30_i2c_io_init,
750 static struct i2c_board_info __initdata i2c_gpio_info[] = {
753 static void __init rk30_i2c_register_board_info(void)
755 #ifdef CONFIG_I2C0_RK30
756 i2c_register_board_info(0, i2c0_info, ARRAY_SIZE(i2c0_info));
758 #ifdef CONFIG_I2C1_RK30
759 i2c_register_board_info(1, i2c1_info, ARRAY_SIZE(i2c1_info));
761 #ifdef CONFIG_I2C2_RK30
762 i2c_register_board_info(2, i2c2_info, ARRAY_SIZE(i2c2_info));
764 #ifdef CONFIG_I2C3_RK30
765 i2c_register_board_info(3, i2c3_info, ARRAY_SIZE(i2c3_info));
767 #ifdef CONFIG_I2C_GPIO_RK30
768 i2c_register_board_info(4, i2c_gpio_info, ARRAY_SIZE(i2c_gpio_info));
773 #define POWER_ON_PIN RK2928_PIN1_PA2 //power_hold
774 static void rk2928_pm_power_off(void)
776 printk(KERN_ERR "rk2928_pm_power_off start...\n");
778 #if defined(CONFIG_MFD_TPS65910)
779 if(g_pmic_type == PMIC_TYPE_TPS65910)
781 tps65910_device_shutdown();//tps65910 shutdown
784 gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
788 static void __init rk2928_board_init(void)
790 gpio_request(POWER_ON_PIN, "poweronpin");
791 gpio_direction_output(POWER_ON_PIN, GPIO_HIGH);
793 pm_power_off = rk2928_pm_power_off;
795 rk30_i2c_register_board_info();
796 spi_register_board_info(board_spi_devices, ARRAY_SIZE(board_spi_devices));
797 platform_add_devices(devices, ARRAY_SIZE(devices));
801 static void __init rk2928_reserve(void)
804 rk30_ion_pdata.heaps[0].base = board_mem_reserve_add("ion", ION_RESERVE_SIZE);
806 #ifdef CONFIG_FB_ROCKCHIP
807 resource_fb[0].start = board_mem_reserve_add("fb0", RK30_FB0_MEM_SIZE);
808 resource_fb[0].end = resource_fb[0].start + RK30_FB0_MEM_SIZE - 1;
810 #ifdef CONFIG_VIDEO_RK29
811 rk30_camera_request_reserve_mem();
813 board_mem_reserved();
816 * dvfs_cpu_logic_table: table for arm and logic dvfs
817 * @frequency : arm frequency
818 * @cpu_volt : arm voltage depend on frequency
819 * @logic_volt : logic voltage arm requests depend on frequency
820 * comments : min arm/logic voltage
822 static struct dvfs_arm_table dvfs_cpu_logic_table[] = {
823 {.frequency = 216 * 1000, .cpu_volt = 1200 * 1000, .logic_volt = 1200 * 1000},//0.975V/1.000V
824 {.frequency = 312 * 1000, .cpu_volt = 1200 * 1000, .logic_volt = 1200 * 1000},//0.975V/1.000V
825 {.frequency = 408 * 1000, .cpu_volt = 1200 * 1000, .logic_volt = 1200 * 1000},//1.000V/1.025V
826 {.frequency = 504 * 1000, .cpu_volt = 1200 * 1000, .logic_volt = 1200 * 1000},//1.000V/1.025V
827 {.frequency = 600 * 1000, .cpu_volt = 1200 * 1000, .logic_volt = 1200 * 1000},//1.025V/1.050V
828 {.frequency = 696 * 1000, .cpu_volt = 1400 * 1000, .logic_volt = 1200 * 1000},//1.000V/1.025V
829 {.frequency = 816 * 1000, .cpu_volt = 1400 * 1000, .logic_volt = 1200 * 1000},//1.100V/1.050V
830 //{.frequency = 912 * 1000, .cpu_volt = 1400 * 1000, .logic_volt = 1200 * 1000},//1.100V/1.050V
831 //{.frequency = 1008 * 1000, .cpu_volt = 1400 * 1000, .logic_volt = 1200 * 1000},//1.100V/1.050V
833 {.frequency = 1104 * 1000, .cpu_volt = 1400 * 1000, .logic_volt = 1200 * 1000},//1.100V/1.050V
834 {.frequency = 1200 * 1000, .cpu_volt = 1400 * 1000, .logic_volt = 1200 * 1000},//1.100V/1.050V
835 {.frequency = 1104 * 1000, .cpu_volt = 1400 * 1000, .logic_volt = 1200 * 1000},//1.100V/1.050V
836 {.frequency = 1248 * 1000, .cpu_volt = 1400 * 1000, .logic_volt = 1200 * 1000},//1.100V/1.050V
838 //{.frequency = 1000 * 1000, .cpu_volt = 1225 * 1000, .logic_volt = 1200 * 1000},//1.150V/1.100V
839 {.frequency = CPUFREQ_TABLE_END},
842 static struct cpufreq_frequency_table dvfs_gpu_table[] = {
843 {.frequency = 266 * 1000, .index = 1050 * 1000},
844 {.frequency = 400 * 1000, .index = 1275 * 1000},
845 {.frequency = CPUFREQ_TABLE_END},
848 static struct cpufreq_frequency_table dvfs_ddr_table[] = {
849 {.frequency = 300 * 1000, .index = 1050 * 1000},
850 {.frequency = 400 * 1000, .index = 1125 * 1000},
851 {.frequency = CPUFREQ_TABLE_END},
854 #define DVFS_CPU_TABLE_SIZE (ARRAY_SIZE(dvfs_cpu_logic_table))
855 static struct cpufreq_frequency_table cpu_dvfs_table[DVFS_CPU_TABLE_SIZE];
856 static struct cpufreq_frequency_table dep_cpu2core_table[DVFS_CPU_TABLE_SIZE];
858 void __init board_clock_init(void)
860 rk2928_clock_data_init(periph_pll_default, codec_pll_default, RK30_CLOCKS_DEFAULT_FLAGS);
861 dvfs_set_arm_logic_volt(dvfs_cpu_logic_table, cpu_dvfs_table, dep_cpu2core_table);
862 dvfs_set_freq_volt_table(clk_get(NULL, "gpu"), dvfs_gpu_table);
863 //dvfs_set_freq_volt_table(clk_get(NULL, "ddr"), dvfs_ddr_table);
864 printk("%s end\n", __func__);
868 MACHINE_START(RK2928, "RK2928board")
869 .boot_params = PLAT_PHYS_OFFSET + 0x800,
870 .fixup = rk2928_fixup,
871 .reserve = &rk2928_reserve,
872 .map_io = rk2928_map_io,
873 .init_irq = rk2928_init_irq,
874 .timer = &rk2928_timer,
875 .init_machine = rk2928_board_init,