mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 04:48:04 +09:00
rk30: add vmac support
This commit is contained in:
@@ -70,14 +70,6 @@ struct rk29_button_light_info{
|
||||
int (*io_deinit)(void);
|
||||
};
|
||||
|
||||
/*vmac*/
|
||||
struct rk29_vmac_platform_data {
|
||||
int (*vmac_register_set)(void);
|
||||
int (*rmii_io_init)(void);
|
||||
int (*rmii_io_deinit)(void);
|
||||
int (*rmii_power_control)(int enable);
|
||||
};
|
||||
|
||||
#define INVALID_GPIO -1
|
||||
|
||||
|
||||
|
||||
@@ -2637,7 +2637,7 @@ static struct clk_lookup clks[] = {
|
||||
CLK1(pclk_timer2),
|
||||
|
||||
CLK(NULL, "rmii_clkin", &rmii_clkin),
|
||||
CLK1(mac_pll_div),
|
||||
CLK(NULL, "mac_ref_div", &clk_mac_pll_div), // compatible with rk29
|
||||
CLK1(mac_ref),
|
||||
CLK1(mii_tx),
|
||||
CLK1(hsadc_pll_div),
|
||||
|
||||
@@ -19,24 +19,27 @@
|
||||
|
||||
static void __init rk30_cpu_axi_init(void)
|
||||
{
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x0088);
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x0108);
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x0188);
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x0388);
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x4008);
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x5008);
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x6008);
|
||||
writel_relaxed(0xa, RK30_CPU_AXI_BUS_BASE + 0x7008);
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x7088);
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x7108);
|
||||
writel_relaxed(0xa, RK30_CPU_AXI_BUS_BASE + 0x7188);
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x7208);
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x7288);
|
||||
writel_relaxed(0x3f, RK30_CPU_AXI_BUS_BASE + 0x0014);
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x0088); // cpu0
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x0108); // dmac1
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x0188); // cpu1r
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x0388); // cpu1w
|
||||
#ifdef CONFIG_RK29_VMAC
|
||||
writel_relaxed(0xa, RK30_CPU_AXI_BUS_BASE + 0x4008); // peri
|
||||
#else
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x4008); // peri
|
||||
#endif
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x5008); // gpu
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x6008); // vpu
|
||||
writel_relaxed(0xa, RK30_CPU_AXI_BUS_BASE + 0x7008); // lcdc0
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x7088); // cif0
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x7108); // ipp
|
||||
writel_relaxed(0xa, RK30_CPU_AXI_BUS_BASE + 0x7188); // lcdc1
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x7208); // cif1
|
||||
writel_relaxed(0x0, RK30_CPU_AXI_BUS_BASE + 0x7288); // rga
|
||||
writel_relaxed(0x3f, RK30_CPU_AXI_BUS_BASE + 0x0014); // memory scheduler read latency
|
||||
dsb();
|
||||
}
|
||||
|
||||
|
||||
#define L2_LY_SP_OFF (0)
|
||||
#define L2_LY_SP_MSK (0x7)
|
||||
|
||||
|
||||
@@ -847,7 +847,6 @@ static struct platform_device device_rga = {
|
||||
};
|
||||
#endif
|
||||
|
||||
//#ifdef CONFIG_RK29_IPP
|
||||
static struct resource resource_ipp[] = {
|
||||
[0] = {
|
||||
.start = RK30_IPP_PHYS,
|
||||
@@ -867,7 +866,6 @@ static struct platform_device device_ipp = {
|
||||
.num_resources = ARRAY_SIZE(resource_ipp),
|
||||
.resource = resource_ipp,
|
||||
};
|
||||
//#endif
|
||||
|
||||
#ifdef CONFIG_SND_RK29_SOC_I2S
|
||||
#ifdef CONFIG_SND_RK29_SOC_I2S_8CH
|
||||
@@ -983,6 +981,7 @@ static void __init rk30_init_i2s(void)
|
||||
#endif
|
||||
platform_device_register(&device_pcm);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USB20_OTG
|
||||
/*DWC_OTG*/
|
||||
static struct resource usb20_otg_resource[] = {
|
||||
@@ -1100,7 +1099,33 @@ static void __init rk30_init_sdmmc(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
extern int rk29sdk_wifi_bt_gpio_control_init(void);
|
||||
#ifdef CONFIG_RK29_VMAC
|
||||
static u64 eth_dmamask = DMA_BIT_MASK(32);
|
||||
static struct resource resources_vmac[] = {
|
||||
[0] = {
|
||||
.start = RK30_MAC_PHYS,
|
||||
.end = RK30_MAC_PHYS + RK30_MAC_SIZE - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = IRQ_MAC,
|
||||
.end = IRQ_MAC,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device device_vmac = {
|
||||
.name = "rk29 vmac",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.dma_mask = ð_dmamask,
|
||||
.coherent_dma_mask = DMA_BIT_MASK(32),
|
||||
.platform_data = &board_vmac_data,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(resources_vmac),
|
||||
.resource = resources_vmac,
|
||||
};
|
||||
#endif
|
||||
|
||||
static int __init rk30_init_devices(void)
|
||||
{
|
||||
@@ -1123,9 +1148,7 @@ static int __init rk30_init_devices(void)
|
||||
#ifdef CONFIG_RGA_RK30
|
||||
platform_device_register(&device_rga);
|
||||
#endif
|
||||
//#ifdef CONFIG_RK29_IPP
|
||||
platform_device_register(&device_ipp);
|
||||
//#endif
|
||||
#ifdef CONFIG_LCDC0_RK30
|
||||
platform_device_register(&device_lcdc0);
|
||||
#endif
|
||||
@@ -1144,6 +1167,9 @@ static int __init rk30_init_devices(void)
|
||||
rk_serial_debug_init(DEBUG_UART_BASE, IRQ_UART0 + CONFIG_RK_DEBUG_UART, IRQ_UART_SIGNAL, -1);
|
||||
#endif
|
||||
rk30_init_i2s();
|
||||
#ifdef CONFIG_RK29_VMAC
|
||||
platform_device_register(&device_vmac);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ extern struct rk29_sdmmc_platform_data default_sdmmc0_data;
|
||||
extern struct rk29_sdmmc_platform_data default_sdmmc1_data;
|
||||
|
||||
extern struct i2c_gpio_platform_data default_i2c_gpio_data;
|
||||
extern struct rk29_vmac_platform_data board_vmac_data;
|
||||
|
||||
void __init rk30_map_common_io(void);
|
||||
void __init rk30_init_irq(void);
|
||||
|
||||
@@ -127,6 +127,14 @@ struct rk29_gpio_expander_info {
|
||||
unsigned int pin_value; //GPIO_HIGH or GPIO_LOW
|
||||
};
|
||||
|
||||
/*vmac*/
|
||||
struct rk29_vmac_platform_data {
|
||||
int (*vmac_register_set)(void);
|
||||
int (*rmii_io_init)(void);
|
||||
int (*rmii_io_deinit)(void);
|
||||
int (*rmii_power_control)(int enable);
|
||||
};
|
||||
|
||||
#define BOOT_MODE_NORMAL 0
|
||||
#define BOOT_MODE_FACTORY2 1
|
||||
#define BOOT_MODE_RECOVERY 2
|
||||
|
||||
Reference in New Issue
Block a user