Sughosh Ganu | 48571ff | 2010-11-30 11:25:01 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Modified for Hawkboard - Syed Mohammed Khasim <khasim@beagleboard.org> |
| 3 | * |
| 4 | * Copyright (C) 2008 Sekhar Nori, Texas Instruments, Inc. <nsekhar@ti.com> |
| 5 | * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net> |
| 6 | * Copyright (C) 2004 Texas Instruments. |
| 7 | * |
| 8 | * ---------------------------------------------------------------------------- |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by |
| 11 | * the Free Software Foundation; either version 2 of the License, or |
| 12 | * (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 22 | * ---------------------------------------------------------------------------- |
| 23 | */ |
| 24 | |
| 25 | #include <common.h> |
| 26 | #include <asm/errno.h> |
| 27 | #include <asm/arch/hardware.h> |
| 28 | #include <asm/io.h> |
| 29 | #include <asm/arch/davinci_misc.h> |
| 30 | #include <ns16550.h> |
Sughosh Ganu | 48571ff | 2010-11-30 11:25:01 -0500 | [diff] [blame] | 31 | |
| 32 | DECLARE_GLOBAL_DATA_PTR; |
| 33 | |
| 34 | int board_init(void) |
| 35 | { |
| 36 | /* arch number of the board */ |
| 37 | gd->bd->bi_arch_number = MACH_TYPE_OMAPL138_HAWKBOARD; |
| 38 | |
| 39 | /* address of boot parameters */ |
| 40 | gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR; |
| 41 | |
| 42 | return 0; |
| 43 | } |
| 44 | |
| 45 | int board_early_init_f(void) |
| 46 | { |
| 47 | /* |
| 48 | * Kick Registers need to be set to allow access to Pin Mux registers |
| 49 | */ |
Christian Riesch | 581a811 | 2011-11-19 00:45:44 +0000 | [diff] [blame] | 50 | writel(DV_SYSCFG_KICK0_UNLOCK, &davinci_syscfg_regs->kick0); |
| 51 | writel(DV_SYSCFG_KICK1_UNLOCK, &davinci_syscfg_regs->kick1); |
Sughosh Ganu | 48571ff | 2010-11-30 11:25:01 -0500 | [diff] [blame] | 52 | |
| 53 | /* set cfgchip3 to select mii */ |
| 54 | writel(readl(&davinci_syscfg_regs->cfgchip3) & |
| 55 | ~(1 << 8), &davinci_syscfg_regs->cfgchip3); |
| 56 | |
| 57 | return 0; |
| 58 | } |
| 59 | |
| 60 | int misc_init_r(void) |
| 61 | { |
| 62 | char buf[32]; |
| 63 | |
| 64 | printf("ARM Clock : %s MHz\n", |
| 65 | strmhz(buf, clk_get(DAVINCI_ARM_CLKID))); |
| 66 | |
| 67 | return 0; |
| 68 | } |