/* Set Initial global variables */ s5pc110_gpio = (struct s5pc110_gpio *)S5PC110_GPIO_BASE; //smc9115_pre_init(); pwm_pre_init(); gd->bd->bi_arch_number = MACH_TYPE_SMDKC100; gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100; return 0; } int dram_init(void) { gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE); return 0; } void dram_init_banksize(void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; } #ifdef CONFIG_DISPLAY_BOARDINFO int checkboard(void) { printf("\nBoard: FriendlyARM-TINY210\n"); return 0; } #endif int board_eth_init(bd_t *bis) { int rc = 0; #ifdef CONFIG_SMC911X rc = smc911x_initialize(0, CONFIG_SMC911X_BASE); #endif return rc; } ulong virt_to_phy_smdkc110(ulong addr) { if ((0xc0000000 <= addr) && (addr < 0xd0000000)) return (addr - 0xc0000000 + 0x20000000); else printf("The input address don't need "\ "a virtual-to-physical translation : %08lx\n", addr); return addr; } #ifdef CONFIG_GENERIC_MMC #define MOUTMMC (50000000) /* 50MHz */ int board_mmc_init(bd_t *bis) { int i; struct s5pc110_clock *clk = (struct s5pc110_clock *)samsung_get_base_clock(); unsigned long clk_src, clk_div, mpll, div; /* * MMC0 GPIO * GPG0[0] SD_0_CLK * GPG0[1] SD_0_CMD * GPG0[2] SD_0_CDn -> Not used * GPG0[3:6] SD_0_DATA[0:3] * * MMC1 GPIO * GPG1[0] SD_1_CLK * GPG1[1] SD_1_CMD * GPG1[2] SD_1_CDn -> Not used * GPG1[3:6] SD_1_DATA[0:3] */ for (i = 0; i < 7; i++) { if (i == 2) continue; /* GPG0[0:6] special function 2 */ s5p_gpio_cfg_pin(&s5pc110_gpio->g0, i, 0x2); /* GPG0[0:6] pull disable */ s5p_gpio_set_pull(&s5pc110_gpio->g0, i, GPIO_PULL_NONE); /* GPG0[0:6] drv 4x */ s5p_gpio_set_drv(&s5pc110_gpio->g0, i, GPIO_DRV_4X); /* GPG1[0:6] special function 2 */ s5p_gpio_cfg_pin(&s5pc110_gpio->g1, i, 0x2); /* GPG1[0:6] pull disable */ s5p_gpio_set_pull(&s5pc110_gpio->g1, i, GPIO_PULL_NONE); /* GPG1[0:6] drv 4x */ s5p_gpio_set_drv(&s5pc110_gpio->g1, i, GPIO_DRV_4X); } clk_src = readl(&clk->res9[0]); /* CLK_SRC4 */ clk_src &= ~((0xf << 4) | 0xf); clk_src |= (0x6 << 4) | 0x6; /* Set MMC0/1_SEL to SCLK_MPLL */ mpll = get_pll_clk(MPLL); div = ((mpll + MOUTMMC) / MOUTMMC) - 1; clk_div = readl(&clk->div4); clk_div &= ~((0xf << 4) | 0xf); clk_div |= (div << 4) | div; writel(clk_src, &clk->res9[0]); writel(clk_div, &clk->div4); return (s5p_mmc_init(0, 4) || s5p_mmc_init(1, 4)); }
int print_cpuinfo(void) { #ifdef CONFIG_EXYNOS5 unsigned int cpuid; unsigned int subrev; __asm__ __volatile__("mrc p15, 0, %0, c0, c0, 0":"=r"(cpuid)); subrev = (readl(EXYNOS5_PRO_ID) & 0x0000000F); printf("CPU: %s%x Rev%x.%x [Samsung SOC on SMP Platform Base on ARM CortexA%d]\n" \ , s5p_get_cpu_name(), s5p_cpu_id, s5p_cpu_rev, subrev, ((cpuid >> 4) & 0xf)); #if defined(CONFIG_CPU_EXYNOS5410) || defined(CONFIG_CPU_EXYNOS5420) unsigned int apll = get_pll_clk(APLL); unsigned int kpll = get_pll_clk(KPLL); unsigned int mpll = get_pll_clk(MPLL); unsigned int bpll = get_pll_clk(BPLL); printf("APLL = %ldMHz, KPLL = %ldMHz\n", apll/1000000, kpll/1000000); printf("MPLL = %ldMHz, BPLL = %ldMHz\n", mpll/1000000, bpll/1000000); #endif #else char buf[32]; if (s5p_cpu_id == 0x4412 || s5p_cpu_id == 0x4212) { printf("CPU: %s%X [Samsung SOC on SMP Platform Base on ARM CortexA9]\n", s5p_get_cpu_name(), s5p_cpu_id); printf("APLL = %ldMHz, MPLL = %ldMHz\n", get_pll_clk(APLL)/1000000, get_pll_clk(MPLL)/1000000); } else printf("CPU:\t%s%X@%sMHz\n", s5p_get_cpu_name(), s5p_cpu_id, strmhz(buf, get_arm_clk())); #endif return 0; }