diff options
author | Wolfgang Denk <wd@denx.de> | 2010-11-26 21:52:52 +0100 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2010-11-26 21:52:52 +0100 |
commit | d4752d5d2c6b240637a51a2f111b1b1a318fb0bf (patch) | |
tree | 70f78b1eadbd6d4ac1f4e7b8b25955da64754a16 /board/davinci/da8xxevm/da850evm.c | |
parent | 50e2df374952549fb378fd342eebeb8afd1103f5 (diff) | |
parent | fc90c06cac1966ca3a4e5826cf795996882d1095 (diff) | |
download | u-boot-imx-d4752d5d2c6b240637a51a2f111b1b1a318fb0bf.zip u-boot-imx-d4752d5d2c6b240637a51a2f111b1b1a318fb0bf.tar.gz u-boot-imx-d4752d5d2c6b240637a51a2f111b1b1a318fb0bf.tar.bz2 |
Merge branch 'master' of /home/wd/git/u-boot/custodians
Diffstat (limited to 'board/davinci/da8xxevm/da850evm.c')
-rw-r--r-- | board/davinci/da8xxevm/da850evm.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c index c8c5e1b..c3267cb 100644 --- a/board/davinci/da8xxevm/da850evm.c +++ b/board/davinci/da8xxevm/da850evm.c @@ -118,6 +118,39 @@ static const struct lpsc_resource lpsc[] = { { DAVINCI_LPSC_GPIO }, }; +#ifndef CONFIG_DA850_EVM_MAX_CPU_CLK +#define CONFIG_DA850_EVM_MAX_CPU_CLK 300000000 +#endif + +/* + * get_board_rev() - setup to pass kernel board revision information + * Returns: + * bit[0-3] Maximum cpu clock rate supported by onboard SoC + * 0000b - 300 MHz + * 0001b - 372 MHz + * 0010b - 408 MHz + * 0011b - 456 MHz + */ +u32 get_board_rev(void) +{ + char *s; + u32 maxcpuclk = CONFIG_DA850_EVM_MAX_CPU_CLK; + u32 rev = 0; + + s = getenv("maxcpuclk"); + if (s) + maxcpuclk = simple_strtoul(s, NULL, 10); + + if (maxcpuclk >= 456000000) + rev = 3; + else if (maxcpuclk >= 408000000) + rev = 2; + else if (maxcpuclk >= 372000000) + rev = 1; + + return rev; +} + int board_init(void) { #ifndef CONFIG_USE_IRQ |