void __init davinci_map_common_io(void) { iotable_init(davinci_io_desc, ARRAY_SIZE(davinci_io_desc)); /* We want to check CPU revision early for cpu_is_davinci_xxxx() macros. * IO space mapping must be initialized before we can do that. */ davinci_check_revision(); if (cpu_is_davinci_dm644x()) { iotable_init(dm644x_io_desc, ARRAY_SIZE(dm644x_io_desc)); } else if (cpu_is_davinci_dm6467()) { davinci_cpu_index = DM6467_CPU_IDX; iotable_init(dm646x_io_desc, ARRAY_SIZE(dm646x_io_desc)); } else if (cpu_is_davinci_dm355()) { davinci_cpu_index = DM355_CPU_IDX; } /* Normally devicemaps_init() would flush caches and tlb after * mdesc->map_io(), but we must also do it here because of the CPU * revision check below. */ flush_tlb_all(); flush_cache_all(); davinci_mux_init(); davinci_clk_init(); }
void __init davinci_common_init(struct davinci_soc_info *soc_info) { int ret; if (!soc_info) { ret = -EINVAL; goto err; } memcpy(&davinci_soc_info, soc_info, sizeof(struct davinci_soc_info)); if (davinci_soc_info.io_desc && (davinci_soc_info.io_desc_num > 0)) iotable_init(davinci_soc_info.io_desc, davinci_soc_info.io_desc_num); init_consistent_dma_size(14 << 20); /* * Normally devicemaps_init() would flush caches and tlb after * mdesc->map_io(), but we must also do it here because of the CPU * revision check below. */ local_flush_tlb_all(); flush_cache_all(); if (!davinci_soc_info.reset) davinci_soc_info.reset = davinci_watchdog_reset; /* * We want to check CPU revision early for cpu_is_xxxx() macros. * IO space mapping must be initialized before we can do that. */ ret = davinci_init_id(&davinci_soc_info); if (ret < 0) goto err; if (davinci_soc_info.cpu_clks) { ret = davinci_clk_init(davinci_soc_info.cpu_clks); if (ret != 0) goto err; } return; err: panic("davinci_common_init: SoC Initialization failed\n"); }
void __init davinci_common_init(struct davinci_soc_info *soc_info) { int ret; struct davinci_id *dip; if (!soc_info) { ret = -EINVAL; goto err; } memcpy(&davinci_soc_info, soc_info, sizeof(struct davinci_soc_info)); if (davinci_soc_info.io_desc && (davinci_soc_info.io_desc_num > 0)) iotable_init(davinci_soc_info.io_desc, davinci_soc_info.io_desc_num); local_flush_tlb_all(); flush_cache_all(); davinci_soc_info.jtag_id = __raw_readl(davinci_soc_info.jtag_id_base); dip = davinci_get_id(davinci_soc_info.jtag_id); if (!dip) { ret = -EINVAL; goto err; } davinci_soc_info.cpu_id = dip->cpu_id; pr_info("DaVinci %s variant 0x%x\n", dip->name, dip->variant); if (davinci_soc_info.cpu_clks) { ret = davinci_clk_init(davinci_soc_info.cpu_clks); if (ret != 0) goto err; } davinci_intc_base = davinci_soc_info.intc_base; davinci_intc_type = davinci_soc_info.intc_type; return; err: pr_err("davinci_common_init: SoC Initialization failed\n"); }
/** * This function will init dm365 board */ void rt_hw_board_init() { psc_change_state(DAVINCI_DM365_LPSC_TIMER0, 3); psc_change_state(DAVINCI_DM365_LPSC_TIMER1, 3); /* initialize the system clock */ //rt_hw_clock_init(); davinci_clk_init(); /* initialize uart */ rt_hw_uart_init(); #ifdef RT_USING_CONSOLE rt_console_set_device(RT_CONSOLE_DEVICE_NAME); #endif /* initialize mmu */ rt_hw_mmu_init(dm365_mem_desc, sizeof(dm365_mem_desc)/sizeof(dm365_mem_desc[0])); /* initialize timer0 */ rt_hw_timer_init(); }
void __init dm644x_init(void) { davinci_common_init(&davinci_soc_info_dm644x); davinci_map_sysmod(); davinci_clk_init(davinci_soc_info_dm644x.cpu_clks); }
void __init davinci_init_common_hw(void) { davinci_mux_init(); davinci_clk_init(); }