#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.32.27
-# Wed Jan 26 16:33:21 2011
+# Tue Feb 15 16:16:01 2011
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
#
# CPU Power Management
#
-CONFIG_CPU_FREQ=y
-CONFIG_CPU_FREQ_TABLE=y
-# CONFIG_CPU_FREQ_DEBUG is not set
-CONFIG_CPU_FREQ_STAT=y
-CONFIG_CPU_FREQ_STAT_DETAILS=y
-# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
-CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
-# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
-CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
-CONFIG_CPU_FREQ_GOV_POWERSAVE=y
-CONFIG_CPU_FREQ_GOV_USERSPACE=y
-CONFIG_CPU_FREQ_GOV_ONDEMAND=y
-CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+# CONFIG_CPU_FREQ is not set
# CONFIG_CPU_IDLE is not set
#
# CONFIG_ISL29003 is not set
# CONFIG_UID_STAT is not set
# CONFIG_WL127X_RFKILL is not set
-CONFIG_APANIC=y
-CONFIG_APANIC_PLABEL="kpanic"
+# CONFIG_APANIC is not set
# CONFIG_STE is not set
# CONFIG_C2PORT is not set
# CONFIG_EEPROM_LEGACY is not set
# CONFIG_EEPROM_MAX6875 is not set
# CONFIG_EEPROM_93CX6 is not set
+CONFIG_RK29_SUPPORT_MODEM=y
+CONFIG_MODEM_ROCKCHIP_DEMO=y
CONFIG_HAVE_IDE=y
# CONFIG_IDE is not set
# CONFIG_USB_USBNET is not set
# CONFIG_USB_HSO is not set
# CONFIG_WAN is not set
-# CONFIG_PPP is not set
+CONFIG_PPP=y
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=y
+CONFIG_PPP_SYNC_TTY=y
+# CONFIG_PPP_DEFLATE is not set
+CONFIG_PPP_BSDCOMP=y
+CONFIG_PPP_MPPE=y
+CONFIG_PPPOE=y
+CONFIG_PPPOL2TP=y
+CONFIG_PPPOLAC=y
+CONFIG_PPPOPNS=y
# CONFIG_SLIP is not set
+CONFIG_SLHC=y
# CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
CONFIG_VIDEO_V4L1=y
CONFIG_VIDEOBUF_GEN=y
CONFIG_VIDEOBUF_DMA_CONTIG=y
+# CONFIG_VIDEO_RK29XX_VOUT is not set
CONFIG_VIDEO_CAPTURE_DRIVERS=y
# CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
# CONFIG_SOC_CAMERA_OV9650 is not set
# CONFIG_SOC_CAMERA_OV3640 is not set
# CONFIG_SOC_CAMERA_OV5642 is not set
+# CONFIG_SOC_CAMERA_OV5640 is not set
CONFIG_SOC_CAMERA_S5K6AA=y
# CONFIG_VIDEO_SH_MOBILE_CEU is not set
CONFIG_VIDEO_RK29=y
#include <mach/rk29_camera.h> /* ddl@rock-chips.com : camera support */
#include <media/soc_camera.h> /* ddl@rock-chips.com : camera support */
#include <mach/vpu_mem.h>
+#include <mach/sram.h>
#include <linux/regulator/rk29-pwm-regulator.h>
#include <linux/regulator/machine.h>
#define MEM_FB_BASE (MEM_CAMIPP_BASE - MEM_FB_SIZE)
#define LINUX_SIZE (MEM_FB_BASE - RK29_SDRAM_PHYS)
+#define PREALLOC_WLAN_SEC_NUM 4
+#define PREALLOC_WLAN_BUF_NUM 160
+#define PREALLOC_WLAN_SECTION_HEADER 24
+
+#define WLAN_SECTION_SIZE_0 (PREALLOC_WLAN_BUF_NUM * 128)
+#define WLAN_SECTION_SIZE_1 (PREALLOC_WLAN_BUF_NUM * 128)
+#define WLAN_SECTION_SIZE_2 (PREALLOC_WLAN_BUF_NUM * 512)
+#define WLAN_SECTION_SIZE_3 (PREALLOC_WLAN_BUF_NUM * 1024)
+
+#define WLAN_SKB_BUF_NUM 16
+
+static struct sk_buff *wlan_static_skb[WLAN_SKB_BUF_NUM];
+
+struct wifi_mem_prealloc {
+ void *mem_ptr;
+ unsigned long size;
+};
+
extern struct sys_timer rk29_timer;
-int rk29_nand_io_init(void)
+static int rk29_nand_io_init(void)
{
return 0;
}
return ret;
}
-struct rk29lcd_info rk29_lcd_info = {
+static struct rk29lcd_info rk29_lcd_info = {
.txd_pin = LCD_TXD_PIN,
.clk_pin = LCD_CLK_PIN,
.cs_pin = LCD_CS_PIN,
return ret;
}
-struct rk29fb_info rk29_fb_info = {
+static struct rk29fb_info rk29_fb_info = {
.fb_id = FB_ID,
.disp_on_pin = FB_DISPLAY_ON_PIN,
.disp_on_value = FB_DISPLAY_ON_VALUE,
};
/* rk29 fb resource */
-struct resource rk29_fb_resource[] = {
+static struct resource rk29_fb_resource[] = {
[0] = {
.name = "lcdc reg",
.start = RK29_LCDC_PHYS,
.platform_data = &rk29_fb_info,
}
};
+
+struct platform_device rk29_device_dma_cpy = {
+ .name = "dma_memcpy",
+ .id = 4,
+
+};
+
#endif
static struct android_pmem_platform_data android_pmem_pdata = {
},
};
+static struct platform_device rk29_v4l2_output_devce = {
+ .name = "rk29_vout",
+};
/*HANNSTAR_P1003 touch*/
#if defined (CONFIG_HANNSTAR_P1003)
},
};
-struct soc_camera_link rk29_iclink_0 = {
+static struct soc_camera_link rk29_iclink_0 = {
.bus_id = RK29_CAM_PLATFORM_DEV_ID,
.power = rk29_sensor_power,
.powerdown = rk29_sensor_powerdown,
};
/*platform_device : soc-camera need */
-struct platform_device rk29_soc_camera_pdrv_0 = {
+static struct platform_device rk29_soc_camera_pdrv_0 = {
.name = "soc-camera-pdrv",
.id = 0,
.dev = {
},
};
-struct soc_camera_link rk29_iclink_1 = {
+static struct soc_camera_link rk29_iclink_1 = {
.bus_id = RK29_CAM_PLATFORM_DEV_ID,
.power = rk29_sensor_power,
.powerdown = rk29_sensor_powerdown,
};
/*platform_device : soc-camera need */
-struct platform_device rk29_soc_camera_pdrv_1 = {
+static struct platform_device rk29_soc_camera_pdrv_1 = {
.name = "soc-camera-pdrv",
.id = 1,
.dev = {
static u64 rockchip_device_camera_dmamask = 0xffffffffUL;
-struct resource rk29_camera_resource[] = {
+static struct resource rk29_camera_resource[] = {
[0] = {
.start = RK29_VIP_PHYS,
.end = RK29_VIP_PHYS + RK29_VIP_SIZE - 1,
};
/*platform_device : */
-struct platform_device rk29_device_camera = {
+static struct platform_device rk29_device_camera = {
.name = RK29_CAM_DRV_NAME,
.id = RK29_CAM_PLATFORM_DEV_ID, /* This is used to put cameras on this interface */
.num_resources = ARRAY_SIZE(rk29_camera_resource),
#define PWM_MUX_NAME GPIO1B5_PWM0_NAME
#define PWM_MUX_MODE GPIO1L_PWM0
#define PWM_MUX_MODE_GPIO GPIO1L_GPIO1B5
+#define PWM_GPIO_PIN RK29_PIN1_PB5
#define PWM_EFFECT_VALUE 1
//#define LCD_DISP_ON_PIN
#define BL_EN_PIN GPIO0L_GPIO0A5
#define BL_EN_VALUE GPIO_HIGH
#endif
+static void rk29_backlight_close(void){
+ int ret;
+ ret = gpio_request(FB_DISPLAY_ON_PIN, NULL);
+ if(ret != 0)
+ {
+ gpio_free(FB_DISPLAY_ON_PIN);
+ printk(">>>>>> FB_DISPLAY_ON_PIN gpio_request err \n ");
+ }
+ gpio_direction_output(FB_DISPLAY_ON_PIN, 0);
+ gpio_set_value(FB_DISPLAY_ON_PIN, GPIO_LOW);
+ gpio_free(FB_DISPLAY_ON_PIN);
+
+ rk29_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
+ ret = gpio_request(PWM_GPIO_PIN, NULL);
+ if(ret != 0)
+ {
+ gpio_free(PWM_GPIO_PIN);
+ printk(">>>>>> FB_DISPLAY_ON_PIN gpio_request err \n ");
+ }
+ gpio_direction_output(PWM_GPIO_PIN, 0);
+ gpio_set_value(PWM_GPIO_PIN, GPIO_HIGH);
+ gpio_free(PWM_GPIO_PIN);
+}
static int rk29_backlight_io_init(void)
{
int ret = 0;
return 0;
}
-static int rk29sdk_wifi_set_carddetect(int val)
+int rk29sdk_wifi_set_carddetect(int val)
{
pr_info("%s:%d\n", __func__, val);
rk29sdk_wifi_cd = val;
}
return 0;
}
+EXPORT_SYMBOL(rk29sdk_wifi_set_carddetect);
+
+static struct wifi_mem_prealloc wifi_mem_array[PREALLOC_WLAN_SEC_NUM] = {
+ {NULL, (WLAN_SECTION_SIZE_0 + PREALLOC_WLAN_SECTION_HEADER)},
+ {NULL, (WLAN_SECTION_SIZE_1 + PREALLOC_WLAN_SECTION_HEADER)},
+ {NULL, (WLAN_SECTION_SIZE_2 + PREALLOC_WLAN_SECTION_HEADER)},
+ {NULL, (WLAN_SECTION_SIZE_3 + PREALLOC_WLAN_SECTION_HEADER)}
+};
+
+static void *rk29sdk_mem_prealloc(int section, unsigned long size)
+{
+ if (section == PREALLOC_WLAN_SEC_NUM)
+ return wlan_static_skb;
+
+ if ((section < 0) || (section > PREALLOC_WLAN_SEC_NUM))
+ return NULL;
+
+ if (wifi_mem_array[section].size < size)
+ return NULL;
+
+ return wifi_mem_array[section].mem_ptr;
+}
+
+int __init rk29sdk_init_wifi_mem(void)
+{
+ int i;
+ int j;
+
+ for (i = 0 ; i < WLAN_SKB_BUF_NUM ; i++) {
+ wlan_static_skb[i] = dev_alloc_skb(
+ ((i < (WLAN_SKB_BUF_NUM / 2)) ? 4096 : 8192));
+
+ if (!wlan_static_skb[i])
+ goto err_skb_alloc;
+ }
+
+ for (i = 0 ; i < PREALLOC_WLAN_SEC_NUM ; i++) {
+ wifi_mem_array[i].mem_ptr =
+ kmalloc(wifi_mem_array[i].size, GFP_KERNEL);
+
+ if (!wifi_mem_array[i].mem_ptr)
+ goto err_mem_alloc;
+ }
+ return 0;
+
+ err_mem_alloc:
+ pr_err("Failed to mem_alloc for WLAN\n");
+ for (j = 0 ; j < i ; j++)
+ kfree(wifi_mem_array[j].mem_ptr);
+
+ i = WLAN_SKB_BUF_NUM;
+
+ err_skb_alloc:
+ pr_err("Failed to skb_alloc for WLAN\n");
+ for (j = 0 ; j < i ; j++)
+ dev_kfree_skb(wlan_static_skb[j]);
+
+ return -ENOMEM;
+}
static struct wifi_platform_data rk29sdk_wifi_control = {
.set_power = rk29sdk_wifi_power,
.set_reset = rk29sdk_wifi_reset,
.set_carddetect = rk29sdk_wifi_set_carddetect,
+ .mem_prealloc = rk29sdk_mem_prealloc,
};
static struct platform_device rk29sdk_wifi_device = {
.name = "bcm4329_wlan",
.flags = IORESOURCE_MEM,
},
};
-struct platform_device rk29_device_gpu = {
+static struct platform_device rk29_device_gpu = {
.name = "galcore",
.id = 0,
.num_resources = ARRAY_SIZE(resources_gpu),
#ifdef CONFIG_FB_RK29
&rk29_device_fb,
+ &rk29_device_dma_cpy,
#endif
#ifdef CONFIG_BACKLIGHT_RK29_BL
&rk29_device_backlight,
#ifdef CONFIG_RK29_IPP
&rk29_device_ipp,
#endif
+#ifdef CONFIG_VIDEO_RK29XX_VOUT
+ &rk29_v4l2_output_devce,
+#endif
};
/*****************************************************************************************
* author: cmc@rock-chips.com
*****************************************************************************************/
#define SPI_CHIPSELECT_NUM 2
-struct spi_cs_gpio rk29xx_spi0_cs_gpios[SPI_CHIPSELECT_NUM] = {
+static struct spi_cs_gpio rk29xx_spi0_cs_gpios[SPI_CHIPSELECT_NUM] = {
{
.name = "spi0 cs0",
.cs_gpio = RK29_PIN2_PC1,
}
};
-struct spi_cs_gpio rk29xx_spi1_cs_gpios[SPI_CHIPSELECT_NUM] = {
+static struct spi_cs_gpio rk29xx_spi1_cs_gpios[SPI_CHIPSELECT_NUM] = {
{
.name = "spi1 cs0",
.cs_gpio = RK29_PIN2_PC5,
#endif
spi_register_board_info(board_spi_devices, ARRAY_SIZE(board_spi_devices));
+
+ rk29sdk_init_wifi_mem();
}
static void __init machine_rk29_fixup(struct machine_desc *desc, struct tag *tags,
static void __init machine_rk29_mapio(void)
{
rk29_map_common_io();
+ rk29_sram_init();
rk29_clock_init();
rk29_iomux_init();
}
--- /dev/null
+#include <mach/key.h>
+#include <mach/gpio.h>
+
+#define EV_ENCALL KEY_F4
+#define EV_MENU KEY_F1
+
+#define PRESS_LEV_LOW 1
+#define PRESS_LEV_HIGH 0
+
+static struct rk29_keys_button key_button[] = {
+#if 0
+ {
+ .desc = "menu",
+ .code = EV_MENU,
+ .gpio = RK29_PIN6_PA0,
+ .active_low = PRESS_LEV_LOW,
+ },
+#endif
+ {
+ .desc = "vol+",
+ .code = KEY_VOLUMEUP,
+ .gpio = RK29_PIN6_PA1,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "vol-",
+ .code = KEY_VOLUMEDOWN,
+ .gpio = RK29_PIN6_PA2,
+ .active_low = PRESS_LEV_LOW,
+ },
+#if 0
+ {
+ .desc = "home",
+ .code = KEY_HOME,
+ .gpio = RK29_PIN6_PA3,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "search",
+ .code = KEY_SEARCH,
+ .gpio = RK29_PIN6_PA4,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "esc",
+ .code = KEY_BACK,
+ .gpio = RK29_PIN6_PA5,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "sensor",
+ .code = KEY_CAMERA,
+ .gpio = RK29_PIN6_PA6,
+ .active_low = PRESS_LEV_LOW,
+ },
+#endif
+ {
+ .desc = "play",
+ .code = EV_ENCALL,
+ .gpio = RK29_PIN6_PA7,
+ .active_low = PRESS_LEV_LOW,
+ .wakeup = 1,
+ },
+#if 0
+ {
+ .desc = "vol+",
+ .code = KEY_VOLUMEDOWN,
+ .adc_value = 95,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "vol-",
+ .code = KEY_VOLUMEUP,
+ .adc_value = 249,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "menu",
+ .code = EV_MENU,
+ .adc_value = 406,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "home",
+ .code = KEY_HOME,
+ .code_long_press = KEY_F4,
+ .adc_value = 561,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "esc",
+ .code = KEY_ESC,
+ .adc_value = 726,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "adkey6",
+ .code = KEY_BACK,
+ .code_long_press = EV_ENCALL,
+ .adc_value = 899,
+ .active_low = PRESS_LEV_LOW,
+ },
+#endif
+};
+struct rk29_keys_platform_data rk29_keys_pdata = {
+ .buttons = key_button,
+ .nbuttons = ARRAY_SIZE(key_button),
+ .chn = -1, //chn: 0-7, if do not use ADC,set 'chn' -1
+};
+