wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 1 | /* |
Wolfgang Denk | b9365a2 | 2006-07-21 11:56:05 +0200 | [diff] [blame] | 2 | * (C) Copyright 2000-2006 |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | * |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 5 | * (C) Copyright 2010 |
| 6 | * Stefan Roese, DENX Software Engineering, sr@denx.de. |
| 7 | * |
Wolfgang Denk | 1b387ef | 2013-09-17 11:24:06 +0200 | [diff] [blame] | 8 | * SPDX-License-Identifier: GPL-2.0 IBM-pibs |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 9 | */ |
Stefan Roese | 3248f63 | 2007-10-22 16:22:40 +0200 | [diff] [blame] | 10 | |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 11 | #include <common.h> |
| 12 | #include <commproc.h> |
| 13 | #include <asm/processor.h> |
Stefan Roese | 3248f63 | 2007-10-22 16:22:40 +0200 | [diff] [blame] | 14 | #include <asm/io.h> |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 15 | #include <watchdog.h> |
Stefan Roese | b36df56 | 2010-09-09 19:18:00 +0200 | [diff] [blame] | 16 | #include <asm/ppc4xx.h> |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 17 | |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 18 | DECLARE_GLOBAL_DATA_PTR; |
| 19 | |
Matthias Fuchs | 3fb8588 | 2013-08-07 12:10:38 +0200 | [diff] [blame] | 20 | #if defined(CONFIG_405GP) || \ |
Stefan Roese | e01bd21 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 21 | defined(CONFIG_405EP) || defined(CONFIG_405EZ) || \ |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 22 | defined(CONFIG_405EX) || defined(CONFIG_440) |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 23 | |
| 24 | #if defined(CONFIG_440) |
Stefan Roese | 6e7fb6e | 2005-11-29 18:18:21 +0100 | [diff] [blame] | 25 | |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 26 | #if defined(CONFIG_440GP) |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 27 | #define CR0_MASK 0x3fff0000 |
| 28 | #define CR0_EXTCLK_ENA 0x00600000 |
| 29 | #define CR0_UDIV_POS 16 |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 30 | #define UDIV_SUBTRACT 1 |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 31 | #define UART0_SDR CPC0_CR0 |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 32 | #define MFREG(a, d) d = mfdcr(a) |
| 33 | #define MTREG(a, d) mtdcr(a, d) |
| 34 | #else /* #if defined(CONFIG_440GP) */ |
| 35 | /* all other 440 PPC's access clock divider via sdr register */ |
| 36 | #define CR0_MASK 0xdfffffff |
| 37 | #define CR0_EXTCLK_ENA 0x00800000 |
| 38 | #define CR0_UDIV_POS 0 |
| 39 | #define UDIV_SUBTRACT 0 |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 40 | #define UART0_SDR SDR0_UART0 |
| 41 | #define UART1_SDR SDR0_UART1 |
Stefan Roese | b2815f7 | 2008-06-06 16:10:41 +0200 | [diff] [blame] | 42 | #if defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \ |
| 43 | defined(CONFIG_440GR) || defined(CONFIG_440GRX) || \ |
| 44 | defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \ |
Stefan Roese | 8ac41e3 | 2008-03-11 15:05:26 +0100 | [diff] [blame] | 45 | defined(CONFIG_460EX) || defined(CONFIG_460GT) |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 46 | #define UART2_SDR SDR0_UART2 |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 47 | #endif |
Stefan Roese | b2815f7 | 2008-06-06 16:10:41 +0200 | [diff] [blame] | 48 | #if defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \ |
| 49 | defined(CONFIG_440GR) || defined(CONFIG_440GRX) || \ |
Stefan Roese | 8ac41e3 | 2008-03-11 15:05:26 +0100 | [diff] [blame] | 50 | defined(CONFIG_460EX) || defined(CONFIG_460GT) |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 51 | #define UART3_SDR SDR0_UART3 |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 52 | #endif |
| 53 | #define MFREG(a, d) mfsdr(a, d) |
| 54 | #define MTREG(a, d) mtsdr(a, d) |
| 55 | #endif /* #if defined(CONFIG_440GP) */ |
Stefan Roese | e01bd21 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 56 | #elif defined(CONFIG_405EP) || defined(CONFIG_405EZ) |
stroese | 8749cfb | 2003-05-23 11:25:57 +0000 | [diff] [blame] | 57 | #define UCR0_MASK 0x0000007f |
| 58 | #define UCR1_MASK 0x00007f00 |
| 59 | #define UCR0_UDIV_POS 0 |
| 60 | #define UCR1_UDIV_POS 8 |
| 61 | #define UDIV_MAX 127 |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 62 | #elif defined(CONFIG_405EX) |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 63 | #define MFREG(a, d) mfsdr(a, d) |
| 64 | #define MTREG(a, d) mtsdr(a, d) |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 65 | #define CR0_MASK 0x000000ff |
| 66 | #define CR0_EXTCLK_ENA 0x00800000 |
| 67 | #define CR0_UDIV_POS 0 |
| 68 | #define UDIV_SUBTRACT 0 |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 69 | #define UART0_SDR SDR0_UART0 |
| 70 | #define UART1_SDR SDR0_UART1 |
Matthias Fuchs | 3fb8588 | 2013-08-07 12:10:38 +0200 | [diff] [blame] | 71 | #else /* CONFIG_405GP */ |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 72 | #define CR0_MASK 0x00001fff |
stroese | d7787c6 | 2003-02-17 16:06:06 +0000 | [diff] [blame] | 73 | #define CR0_EXTCLK_ENA 0x000000c0 |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 74 | #define CR0_UDIV_POS 1 |
stroese | 8749cfb | 2003-05-23 11:25:57 +0000 | [diff] [blame] | 75 | #define UDIV_MAX 32 |
| 76 | #endif |
| 77 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 78 | #if defined(CONFIG_405EP) && defined(CONFIG_SYS_EXT_SERIAL_CLOCK) |
Wolfgang Denk | 0c8721a | 2005-09-23 11:05:55 +0200 | [diff] [blame] | 79 | #error "External serial clock not supported on AMCC PPC405EP!" |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 80 | #endif |
| 81 | |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 82 | #if (defined(CONFIG_405EX) || defined(CONFIG_405EZ) || \ |
| 83 | defined(CONFIG_440)) && !defined(CONFIG_SYS_EXT_SERIAL_CLOCK) |
| 84 | /* |
| 85 | * For some SoC's, the cpu clock is on divider chain A, UART on |
| 86 | * divider chain B ... so cpu clock is irrelevant. Get the |
| 87 | * "optimized" values that are subject to the 1/2 opb clock |
| 88 | * constraint. |
| 89 | */ |
| 90 | static u16 serial_bdiv(int baudrate, u32 *udiv) |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 91 | { |
Stefan Roese | e01bd21 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 92 | sys_info_t sysinfo; |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 93 | u32 div; /* total divisor udiv * bdiv */ |
| 94 | u32 umin; /* minimum udiv */ |
| 95 | u16 diff; /* smallest diff */ |
| 96 | u16 idiff; /* current diff */ |
| 97 | u16 ibdiv; /* current bdiv */ |
| 98 | u32 i; |
| 99 | u32 est; /* current estimate */ |
| 100 | u32 max; |
| 101 | #if defined(CONFIG_405EZ) |
| 102 | u32 cpr_pllc; |
| 103 | u32 plloutb; |
| 104 | u32 reg; |
| 105 | #endif |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 106 | |
Stefan Roese | e01bd21 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 107 | get_sys_info(&sysinfo); |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 108 | |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 109 | #if defined(CONFIG_405EZ) |
Stefan Roese | 273db7e | 2007-08-13 09:05:33 +0200 | [diff] [blame] | 110 | /* check the pll feedback source */ |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 111 | mfcpr(CPR0_PLLC, cpr_pllc); |
Stefan Roese | 429d957 | 2007-08-14 15:03:17 +0200 | [diff] [blame] | 112 | plloutb = ((CONFIG_SYS_CLK_FREQ * ((cpr_pllc & PLLC_SRC_MASK) ? |
Stefan Roese | 3248f63 | 2007-10-22 16:22:40 +0200 | [diff] [blame] | 113 | sysinfo.pllFwdDivB : sysinfo.pllFwdDiv) * |
| 114 | sysinfo.pllFbkDiv) / sysinfo.pllFwdDivB); |
Stefan Roese | e01bd21 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 115 | div = plloutb / (16 * baudrate); /* total divisor */ |
| 116 | umin = (plloutb / get_OPB_freq()) << 1; /* 2 x OPB divisor */ |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 117 | max = 256; /* highest possible */ |
| 118 | #else /* 405EZ */ |
| 119 | div = sysinfo.freqPLB / (16 * baudrate); /* total divisor */ |
| 120 | umin = sysinfo.pllOpbDiv << 1; /* 2 x OPB divisor */ |
| 121 | max = 32; /* highest possible */ |
| 122 | #endif /* 405EZ */ |
Stefan Roese | e01bd21 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 123 | |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 124 | *udiv = diff = max; |
| 125 | |
| 126 | /* |
| 127 | * i is the test udiv value -- start with the largest |
| 128 | * possible (max) to minimize serial clock and constrain |
Stefan Roese | e01bd21 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 129 | * search to umin. |
| 130 | */ |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 131 | for (i = max; i > umin; i--) { |
Stefan Roese | e01bd21 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 132 | ibdiv = div / i; |
| 133 | est = i * ibdiv; |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 134 | idiff = (est > div) ? (est - div) : (div - est); |
Stefan Roese | e01bd21 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 135 | if (idiff == 0) { |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 136 | *udiv = i; |
| 137 | break; /* can't do better */ |
Stefan Roese | e01bd21 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 138 | } else if (idiff < diff) { |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 139 | *udiv = i; /* best so far */ |
| 140 | diff = idiff; /* update lowest diff*/ |
Stefan Roese | e01bd21 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 141 | } |
| 142 | } |
| 143 | |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 144 | #if defined(CONFIG_405EZ) |
Stefan Roese | afabb49 | 2010-09-12 06:21:37 +0200 | [diff] [blame] | 145 | mfcpr(CPR0_PERD0, reg); |
Stefan Roese | e01bd21 | 2007-03-21 13:38:59 +0100 | [diff] [blame] | 146 | reg &= ~0x0000ffff; |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 147 | reg |= ((*udiv - 0) << 8) | (*udiv - 0); |
Stefan Roese | afabb49 | 2010-09-12 06:21:37 +0200 | [diff] [blame] | 148 | mtcpr(CPR0_PERD0, reg); |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 149 | #endif |
| 150 | |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 151 | return div / *udiv; |
| 152 | } |
| 153 | #endif /* #if (defined(CONFIG_405EP) ... */ |
| 154 | |
| 155 | /* |
| 156 | * This function returns the UART clock used by the common |
| 157 | * NS16550 driver. Additionally the SoC internal divisors for |
| 158 | * optimal UART baudrate are configured. |
| 159 | */ |
| 160 | int get_serial_clock(void) |
| 161 | { |
| 162 | u32 clk; |
| 163 | u32 udiv; |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 164 | #if !defined(CONFIG_405EZ) |
| 165 | u32 reg; |
| 166 | #endif |
| 167 | #if !defined(CONFIG_SYS_EXT_SERIAL_CLOCK) |
| 168 | PPC4xx_SYS_INFO sys_info; |
| 169 | #endif |
| 170 | |
| 171 | /* |
| 172 | * Programming of the internal divisors is SoC specific. |
| 173 | * Let's handle this in some #ifdef's for the SoC's. |
| 174 | */ |
| 175 | |
Matthias Fuchs | 3fb8588 | 2013-08-07 12:10:38 +0200 | [diff] [blame] | 176 | #if defined(CONFIG_405GP) |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 177 | reg = mfdcr(CPC0_CR0) & ~CR0_MASK; |
| 178 | #ifdef CONFIG_SYS_EXT_SERIAL_CLOCK |
| 179 | clk = CONFIG_SYS_EXT_SERIAL_CLOCK; |
| 180 | udiv = 1; |
| 181 | reg |= CR0_EXTCLK_ENA; |
| 182 | #else /* CONFIG_SYS_EXT_SERIAL_CLOCK */ |
| 183 | clk = gd->cpu_clk; |
| 184 | #ifdef CONFIG_SYS_405_UART_ERRATA_59 |
| 185 | udiv = 31; /* Errata 59: stuck at 31 */ |
| 186 | #else /* CONFIG_SYS_405_UART_ERRATA_59 */ |
Wolfgang Denk | 32bb34a | 2011-10-29 09:37:52 +0000 | [diff] [blame] | 187 | { |
| 188 | u32 tmp = CONFIG_SYS_BASE_BAUD * 16; |
| 189 | |
| 190 | udiv = (clk + tmp / 2) / tmp; |
| 191 | } |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 192 | if (udiv > UDIV_MAX) /* max. n bits for udiv */ |
| 193 | udiv = UDIV_MAX; |
| 194 | #endif /* CONFIG_SYS_405_UART_ERRATA_59 */ |
| 195 | #endif /* CONFIG_SYS_EXT_SERIAL_CLOCK */ |
| 196 | reg |= (udiv - 1) << CR0_UDIV_POS; /* set the UART divisor */ |
| 197 | mtdcr (CPC0_CR0, reg); |
| 198 | #ifdef CONFIG_SYS_EXT_SERIAL_CLOCK |
| 199 | clk = CONFIG_SYS_EXT_SERIAL_CLOCK; |
| 200 | #else |
| 201 | clk = CONFIG_SYS_BASE_BAUD * 16; |
| 202 | #endif |
Matthias Fuchs | 3fb8588 | 2013-08-07 12:10:38 +0200 | [diff] [blame] | 203 | #endif |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 204 | |
| 205 | #if defined(CONFIG_405EP) |
Wolfgang Denk | 32bb34a | 2011-10-29 09:37:52 +0000 | [diff] [blame] | 206 | { |
| 207 | u32 tmp = CONFIG_SYS_BASE_BAUD * 16; |
| 208 | |
| 209 | reg = mfdcr(CPC0_UCR) & ~(UCR0_MASK | UCR1_MASK); |
| 210 | clk = gd->cpu_clk; |
| 211 | udiv = (clk + tmp / 2) / tmp; |
| 212 | if (udiv > UDIV_MAX) /* max. n bits for udiv */ |
| 213 | udiv = UDIV_MAX; |
| 214 | } |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 215 | reg |= udiv << UCR0_UDIV_POS; /* set the UART divisor */ |
| 216 | reg |= udiv << UCR1_UDIV_POS; /* set the UART divisor */ |
| 217 | mtdcr(CPC0_UCR, reg); |
| 218 | clk = CONFIG_SYS_BASE_BAUD * 16; |
| 219 | #endif /* CONFIG_405EP */ |
| 220 | |
| 221 | #if defined(CONFIG_405EX) || defined(CONFIG_440) |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 222 | MFREG(UART0_SDR, reg); |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 223 | reg &= ~CR0_MASK; |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 224 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 225 | #ifdef CONFIG_SYS_EXT_SERIAL_CLOCK |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 226 | reg |= CR0_EXTCLK_ENA; |
| 227 | udiv = 1; |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 228 | clk = CONFIG_SYS_EXT_SERIAL_CLOCK; |
| 229 | #else /* CONFIG_SYS_EXT_SERIAL_CLOCK */ |
| 230 | clk = gd->baudrate * serial_bdiv(gd->baudrate, &udiv) * 16; |
| 231 | #endif /* CONFIG_SYS_EXT_SERIAL_CLOCK */ |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 232 | |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 233 | reg |= (udiv - UDIV_SUBTRACT) << CR0_UDIV_POS; /* set the UART divisor */ |
| 234 | |
| 235 | /* |
| 236 | * Configure input clock to baudrate generator for all |
| 237 | * available serial ports here |
| 238 | */ |
| 239 | MTREG(UART0_SDR, reg); |
| 240 | #if defined(UART1_SDR) |
| 241 | MTREG(UART1_SDR, reg); |
wdenk | ff36fd8 | 2005-01-09 22:28:56 +0000 | [diff] [blame] | 242 | #endif |
Stefan Roese | 887e2ec | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 243 | #if defined(UART2_SDR) |
| 244 | MTREG(UART2_SDR, reg); |
| 245 | #endif |
| 246 | #if defined(UART3_SDR) |
| 247 | MTREG(UART3_SDR, reg); |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 248 | #endif |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 249 | #endif /* CONFIG_405EX ... */ |
wdenk | ff36fd8 | 2005-01-09 22:28:56 +0000 | [diff] [blame] | 250 | |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 251 | #if defined(CONFIG_405EZ) |
| 252 | clk = gd->baudrate * serial_bdiv(gd->baudrate, &udiv) * 16; |
| 253 | #endif /* CONFIG_405EZ */ |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 254 | |
| 255 | /* |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 256 | * Correct UART frequency in bd-info struct now that |
| 257 | * the UART divisor is available |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 258 | */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 259 | #ifdef CONFIG_SYS_EXT_SERIAL_CLOCK |
Simon Glass | 3a1dc8f | 2012-12-13 20:48:59 +0000 | [diff] [blame] | 260 | gd->arch.uart_clk = CONFIG_SYS_EXT_SERIAL_CLOCK; |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 261 | #else |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 262 | get_sys_info(&sys_info); |
Simon Glass | 3a1dc8f | 2012-12-13 20:48:59 +0000 | [diff] [blame] | 263 | gd->arch.uart_clk = sys_info.freqUART / udiv; |
Jon Loeliger | 068b60a | 2007-07-10 10:27:39 -0500 | [diff] [blame] | 264 | #endif |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 265 | |
Stefan Roese | 550650d | 2010-09-20 16:05:31 +0200 | [diff] [blame] | 266 | return clk; |
wdenk | ff36fd8 | 2005-01-09 22:28:56 +0000 | [diff] [blame] | 267 | } |
Matthias Fuchs | 3fb8588 | 2013-08-07 12:10:38 +0200 | [diff] [blame] | 268 | #endif /* CONFIG_405GP */ |