| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: beagle_machdep.c,v 1.36 2013/02/09 22:11:29 christos Exp $ */ | | 1 | /* $NetBSD: beagle_machdep.c,v 1.37 2013/03/13 03:03:04 khorben Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Machine dependent functions for kernel setup for TI OSK5912 board. | | 4 | * Machine dependent functions for kernel setup for TI OSK5912 board. |
5 | * Based on lubbock_machdep.c which in turn was based on iq80310_machhdep.c | | 5 | * Based on lubbock_machdep.c which in turn was based on iq80310_machhdep.c |
6 | * | | 6 | * |
7 | * Copyright (c) 2002, 2003, 2005 Genetec Corporation. All rights reserved. | | 7 | * Copyright (c) 2002, 2003, 2005 Genetec Corporation. All rights reserved. |
8 | * Written by Hiroyuki Bessho for Genetec Corporation. | | 8 | * Written by Hiroyuki Bessho for Genetec Corporation. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -115,27 +115,27 @@ | | | @@ -115,27 +115,27 @@ |
115 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | | 115 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
116 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 116 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
117 | * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTERS BE LIABLE FOR ANY DIRECT, | | 117 | * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTERS BE LIABLE FOR ANY DIRECT, |
118 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | | 118 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
119 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | | 119 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
120 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 120 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
121 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 121 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
122 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 122 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
123 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 123 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
124 | * SUCH DAMAGE. | | 124 | * SUCH DAMAGE. |
125 | */ | | 125 | */ |
126 | | | 126 | |
127 | #include <sys/cdefs.h> | | 127 | #include <sys/cdefs.h> |
128 | __KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.36 2013/02/09 22:11:29 christos Exp $"); | | 128 | __KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.37 2013/03/13 03:03:04 khorben Exp $"); |
129 | | | 129 | |
130 | #include "opt_machdep.h" | | 130 | #include "opt_machdep.h" |
131 | #include "opt_ddb.h" | | 131 | #include "opt_ddb.h" |
132 | #include "opt_kgdb.h" | | 132 | #include "opt_kgdb.h" |
133 | #include "opt_ipkdb.h" | | 133 | #include "opt_ipkdb.h" |
134 | #include "opt_md.h" | | 134 | #include "opt_md.h" |
135 | #include "opt_com.h" | | 135 | #include "opt_com.h" |
136 | #include "opt_omap.h" | | 136 | #include "opt_omap.h" |
137 | #include "prcm.h" | | 137 | #include "prcm.h" |
138 | | | 138 | |
139 | #include <sys/param.h> | | 139 | #include <sys/param.h> |
140 | #include <sys/systm.h> | | 140 | #include <sys/systm.h> |
141 | #include <sys/bus.h> | | 141 | #include <sys/bus.h> |
| @@ -193,27 +193,31 @@ BootConfig bootconfig; /* Boot config s | | | @@ -193,27 +193,31 @@ BootConfig bootconfig; /* Boot config s |
193 | static char bootargs[MAX_BOOT_STRING]; | | 193 | static char bootargs[MAX_BOOT_STRING]; |
194 | char *boot_args = NULL; | | 194 | char *boot_args = NULL; |
195 | char *boot_file = NULL; | | 195 | char *boot_file = NULL; |
196 | | | 196 | |
197 | static uint8_t beagle_edid[128]; /* EDID storage */ | | 197 | static uint8_t beagle_edid[128]; /* EDID storage */ |
198 | | | 198 | |
199 | u_int uboot_args[4] = { 0 }; /* filled in by beagle_start.S (not in bss) */ | | 199 | u_int uboot_args[4] = { 0 }; /* filled in by beagle_start.S (not in bss) */ |
200 | | | 200 | |
201 | /* Same things, but for the free (unused by the kernel) memory. */ | | 201 | /* Same things, but for the free (unused by the kernel) memory. */ |
202 | | | 202 | |
203 | extern char KERNEL_BASE_phys[]; | | 203 | extern char KERNEL_BASE_phys[]; |
204 | extern char _end[]; | | 204 | extern char _end[]; |
205 | | | 205 | |
| | | 206 | #if NCOM > 0 |
206 | int use_fb_console = false; | | 207 | int use_fb_console = false; |
| | | 208 | #else |
| | | 209 | int use_fb_console = true; |
| | | 210 | #endif |
207 | | | 211 | |
208 | /* | | 212 | /* |
209 | * Macros to translate between physical and virtual for a subset of the | | 213 | * Macros to translate between physical and virtual for a subset of the |
210 | * kernel address space. *Not* for general use. | | 214 | * kernel address space. *Not* for general use. |
211 | */ | | 215 | */ |
212 | #define KERNEL_BASE_PHYS ((paddr_t)KERNEL_BASE_phys) | | 216 | #define KERNEL_BASE_PHYS ((paddr_t)KERNEL_BASE_phys) |
213 | | | 217 | |
214 | /* Prototypes */ | | 218 | /* Prototypes */ |
215 | | | 219 | |
216 | void consinit(void); | | 220 | void consinit(void); |
217 | #ifdef KGDB | | 221 | #ifdef KGDB |
218 | static void kgdb_port_init(void); | | 222 | static void kgdb_port_init(void); |
219 | #endif | | 223 | #endif |
| @@ -221,27 +225,27 @@ static void kgdb_port_init(void); | | | @@ -221,27 +225,27 @@ static void kgdb_port_init(void); |
221 | static void init_clocks(void); | | 225 | static void init_clocks(void); |
222 | static void beagle_device_register(device_t, void *); | | 226 | static void beagle_device_register(device_t, void *); |
223 | static void beagle_reset(void); | | 227 | static void beagle_reset(void); |
224 | #if defined(OMAP_3430) || defined(OMAP_3530) || defined(TI_DM37XX) | | 228 | #if defined(OMAP_3430) || defined(OMAP_3530) || defined(TI_DM37XX) |
225 | static void omap3_cpu_clk(void); | | 229 | static void omap3_cpu_clk(void); |
226 | #endif | | 230 | #endif |
227 | #if defined(OMAP_4430) | | 231 | #if defined(OMAP_4430) |
228 | static void omap4_cpu_clk(void); | | 232 | static void omap4_cpu_clk(void); |
229 | #endif | | 233 | #endif |
230 | #if defined(TI_AM335X) | | 234 | #if defined(TI_AM335X) |
231 | static void am335x_cpu_clk(void); | | 235 | static void am335x_cpu_clk(void); |
232 | #endif | | 236 | #endif |
233 | | | 237 | |
234 | #if defined(OMAP_3530) || defined(OMAP_3430) | | 238 | #if defined(OMAP_3430) || defined(OMAP_3530) |
235 | static psize_t omap3530_memprobe(void); | | 239 | static psize_t omap3530_memprobe(void); |
236 | #endif | | 240 | #endif |
237 | | | 241 | |
238 | bs_protos(bs_notimpl); | | 242 | bs_protos(bs_notimpl); |
239 | | | 243 | |
240 | #include "com.h" | | 244 | #include "com.h" |
241 | #if NCOM > 0 | | 245 | #if NCOM > 0 |
242 | #include <dev/ic/comreg.h> | | 246 | #include <dev/ic/comreg.h> |
243 | #include <dev/ic/comvar.h> | | 247 | #include <dev/ic/comvar.h> |
244 | #endif | | 248 | #endif |
245 | | | 249 | |
246 | /* | | 250 | /* |
247 | * Static device mappings. These peripheral registers are mapped at | | 251 | * Static device mappings. These peripheral registers are mapped at |
| @@ -353,38 +357,40 @@ beagle_db_trap(int where) | | | @@ -353,38 +357,40 @@ beagle_db_trap(int where) |
353 | if (where) { | | 357 | if (where) { |
354 | oldwatchdogstate = omapwdt32k_enable(0); | | 358 | oldwatchdogstate = omapwdt32k_enable(0); |
355 | } else { | | 359 | } else { |
356 | omapwdt32k_enable(oldwatchdogstate); | | 360 | omapwdt32k_enable(oldwatchdogstate); |
357 | } | | 361 | } |
358 | #endif | | 362 | #endif |
359 | } | | 363 | } |
360 | #endif | | 364 | #endif |
361 | | | 365 | |
362 | void beagle_putchar(char c); | | 366 | void beagle_putchar(char c); |
363 | void | | 367 | void |
364 | beagle_putchar(char c) | | 368 | beagle_putchar(char c) |
365 | { | | 369 | { |
| | | 370 | #if NCOM > 0 |
366 | unsigned char *com0addr = (char *)CONSADDR_VA; | | 371 | unsigned char *com0addr = (char *)CONSADDR_VA; |
367 | int timo = 150000; | | 372 | int timo = 150000; |
368 | | | 373 | |
369 | while ((com0addr[5 * 4] & 0x20) == 0) | | 374 | while ((com0addr[5 * 4] & 0x20) == 0) |
370 | if (--timo == 0) | | 375 | if (--timo == 0) |
371 | break; | | 376 | break; |
372 | | | 377 | |
373 | com0addr[0] = c; | | 378 | com0addr[0] = c; |
374 | | | 379 | |
375 | while ((com0addr[5 * 4] & 0x20) == 0) | | 380 | while ((com0addr[5 * 4] & 0x20) == 0) |
376 | if (--timo == 0) | | 381 | if (--timo == 0) |
377 | break; | | 382 | break; |
| | | 383 | #endif |
378 | } | | 384 | } |
379 | | | 385 | |
380 | /* | | 386 | /* |
381 | * u_int initarm(...) | | 387 | * u_int initarm(...) |
382 | * | | 388 | * |
383 | * Initial entry point on startup. This gets called before main() is | | 389 | * Initial entry point on startup. This gets called before main() is |
384 | * entered. | | 390 | * entered. |
385 | * It should be responsible for setting up everything that must be | | 391 | * It should be responsible for setting up everything that must be |
386 | * in place when main is called. | | 392 | * in place when main is called. |
387 | * This includes | | 393 | * This includes |
388 | * Taking a copy of the boot configuration structure. | | 394 | * Taking a copy of the boot configuration structure. |
389 | * Initialising the physical console so characters can be printed. | | 395 | * Initialising the physical console so characters can be printed. |
390 | * Setting up page tables for the kernel | | 396 | * Setting up page tables for the kernel |
| @@ -442,27 +448,27 @@ initarm(void *arg) | | | @@ -442,27 +448,27 @@ initarm(void *arg) |
442 | #ifdef BOOT_ARGSt | | 448 | #ifdef BOOT_ARGSt |
443 | char mi_bootargs[] = BOOT_ARGS; | | 449 | char mi_bootargs[] = BOOT_ARGS; |
444 | parse_mi_bootargs(mi_bootargs); | | 450 | parse_mi_bootargs(mi_bootargs); |
445 | #endif | | 451 | #endif |
446 | | | 452 | |
447 | #ifdef VERBOSE_INIT_ARM | | 453 | #ifdef VERBOSE_INIT_ARM |
448 | printf("initarm: Configuring system ...\n"); | | 454 | printf("initarm: Configuring system ...\n"); |
449 | #endif | | 455 | #endif |
450 | | | 456 | |
451 | /* | | 457 | /* |
452 | * Set up the variables that define the availability of physical | | 458 | * Set up the variables that define the availability of physical |
453 | * memory. | | 459 | * memory. |
454 | */ | | 460 | */ |
455 | #if defined(OMAP_3530) || defined(OMAP_3430) | | 461 | #if defined(OMAP_3430) || defined(OMAP_3530) |
456 | ram_size = omap3530_memprobe(); | | 462 | ram_size = omap3530_memprobe(); |
457 | #endif | | 463 | #endif |
458 | /* | | 464 | /* |
459 | * If MEMSIZE specified less than what we really have, limit ourselves | | 465 | * If MEMSIZE specified less than what we really have, limit ourselves |
460 | * to that. | | 466 | * to that. |
461 | */ | | 467 | */ |
462 | #ifdef MEMSIZE | | 468 | #ifdef MEMSIZE |
463 | if (ram_size == 0 || ram_size > MEMSIZE * 1024 * 1024) | | 469 | if (ram_size == 0 || ram_size > MEMSIZE * 1024 * 1024) |
464 | ram_size = MEMSIZE * 1024 * 1024; | | 470 | ram_size = MEMSIZE * 1024 * 1024; |
465 | #else | | 471 | #else |
466 | KASSERTMSG(ram_size > 0, "RAM size unknown and MEMSIZE undefined"); | | 472 | KASSERTMSG(ram_size > 0, "RAM size unknown and MEMSIZE undefined"); |
467 | #endif | | 473 | #endif |
468 | | | 474 | |
| @@ -504,61 +510,67 @@ init_clocks(void) | | | @@ -504,61 +510,67 @@ init_clocks(void) |
504 | uint32_t v; | | 510 | uint32_t v; |
505 | beagle_putchar('E'); | | 511 | beagle_putchar('E'); |
506 | v = *clksel_reg; | | 512 | v = *clksel_reg; |
507 | beagle_putchar('F'); | | 513 | beagle_putchar('F'); |
508 | if (v != OMAP3530_CM_CLKSEL_MPU_FULLSPEED) { | | 514 | if (v != OMAP3530_CM_CLKSEL_MPU_FULLSPEED) { |
509 | printf("Changed CPU speed from half (%d) ", v); | | 515 | printf("Changed CPU speed from half (%d) ", v); |
510 | *clksel_reg = OMAP3530_CM_CLKSEL_MPU_FULLSPEED; | | 516 | *clksel_reg = OMAP3530_CM_CLKSEL_MPU_FULLSPEED; |
511 | printf("to full speed.\n"); | | 517 | printf("to full speed.\n"); |
512 | } | | 518 | } |
513 | beagle_putchar('G'); | | 519 | beagle_putchar('G'); |
514 | #endif | | 520 | #endif |
515 | } | | 521 | } |
516 | | | 522 | |
| | | 523 | #if NCOM > 0 |
517 | #ifndef CONSADDR | | 524 | #ifndef CONSADDR |
518 | #error Specify the address of the console UART with the CONSADDR option. | | 525 | #error Specify the address of the console UART with the CONSADDR option. |
519 | #endif | | 526 | #endif |
520 | #ifndef CONSPEED | | 527 | #ifndef CONSPEED |
521 | #define CONSPEED 115200 | | 528 | #define CONSPEED 115200 |
522 | #endif | | 529 | #endif |
523 | #ifndef CONMODE | | 530 | #ifndef CONMODE |
524 | #define CONMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */ | | 531 | #define CONMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */ |
525 | #endif | | 532 | #endif |
526 | | | 533 | |
527 | static const bus_addr_t consaddr = CONSADDR; | | 534 | static const bus_addr_t consaddr = CONSADDR; |
528 | static const int conspeed = CONSPEED; | | 535 | static const int conspeed = CONSPEED; |
529 | static const int conmode = CONMODE; | | 536 | static const int conmode = CONMODE; |
| | | 537 | #endif |
530 | | | 538 | |
531 | void | | 539 | void |
532 | consinit(void) | | 540 | consinit(void) |
533 | { | | 541 | { |
| | | 542 | #if NCOM > 0 |
534 | bus_space_handle_t bh; | | 543 | bus_space_handle_t bh; |
| | | 544 | #endif |
535 | static int consinit_called = 0; | | 545 | static int consinit_called = 0; |
536 | | | 546 | |
537 | if (consinit_called != 0) | | 547 | if (consinit_called != 0) |
538 | return; | | 548 | return; |
539 | | | 549 | |
540 | consinit_called = 1; | | 550 | consinit_called = 1; |
541 | | | 551 | |
542 | beagle_putchar('e'); | | 552 | beagle_putchar('e'); |
543 | | | 553 | |
| | | 554 | #if NCOM > 0 |
544 | if (bus_space_map(&omap_a4x_bs_tag, consaddr, OMAP_COM_SIZE, 0, &bh)) | | 555 | if (bus_space_map(&omap_a4x_bs_tag, consaddr, OMAP_COM_SIZE, 0, &bh)) |
545 | panic("Serial console can not be mapped."); | | 556 | panic("Serial console can not be mapped."); |
546 | | | 557 | |
547 | if (comcnattach(&omap_a4x_bs_tag, consaddr, conspeed, | | 558 | if (comcnattach(&omap_a4x_bs_tag, consaddr, conspeed, |
548 | OMAP_COM_FREQ, COM_TYPE_NORMAL, conmode)) | | 559 | OMAP_COM_FREQ, COM_TYPE_NORMAL, conmode)) |
549 | panic("Serial console can not be initialized."); | | 560 | panic("Serial console can not be initialized."); |
550 | | | 561 | |
551 | bus_space_unmap(&omap_a4x_bs_tag, bh, OMAP_COM_SIZE); | | 562 | bus_space_unmap(&omap_a4x_bs_tag, bh, OMAP_COM_SIZE); |
| | | 563 | #endif |
552 | | | 564 | |
553 | #if NUKBD > 0 | | 565 | #if NUKBD > 0 |
554 | ukbd_cnattach(); /* allow USB keyboard to become console */ | | 566 | ukbd_cnattach(); /* allow USB keyboard to become console */ |
555 | #endif | | 567 | #endif |
556 | | | 568 | |
557 | beagle_putchar('f'); | | 569 | beagle_putchar('f'); |
558 | beagle_putchar('g'); | | 570 | beagle_putchar('g'); |
559 | } | | 571 | } |
560 | | | 572 | |
561 | void | | 573 | void |
562 | beagle_reset(void) | | 574 | beagle_reset(void) |
563 | { | | 575 | { |
564 | #if defined(OMAP_4430) | | 576 | #if defined(OMAP_4430) |
| @@ -669,27 +681,27 @@ am335x_cpu_clk(void) | | | @@ -669,27 +681,27 @@ am335x_cpu_clk(void) |
669 | const uint32_t clksel_dpll_mpu = *(volatile uint32_t *)(cm_wkup_base + TI_AM335X_CM_CLKSEL_DPLL_MPU); | | 681 | const uint32_t clksel_dpll_mpu = *(volatile uint32_t *)(cm_wkup_base + TI_AM335X_CM_CLKSEL_DPLL_MPU); |
670 | const uint32_t div_m2_dpll_mpu = *(volatile uint32_t *)(cm_wkup_base + TI_AM335X_CM_DIV_M2_DPLL_MPU); | | 682 | const uint32_t div_m2_dpll_mpu = *(volatile uint32_t *)(cm_wkup_base + TI_AM335X_CM_DIV_M2_DPLL_MPU); |
671 | const uint32_t m = __SHIFTOUT(clksel_dpll_mpu, TI_AM335X_CM_CLKSEL_DPLL_MPU_DPLL_MULT); | | 683 | const uint32_t m = __SHIFTOUT(clksel_dpll_mpu, TI_AM335X_CM_CLKSEL_DPLL_MPU_DPLL_MULT); |
672 | const uint32_t n = __SHIFTOUT(clksel_dpll_mpu, TI_AM335X_CM_CLKSEL_DPLL_MPU_DPLL_DIV); | | 684 | const uint32_t n = __SHIFTOUT(clksel_dpll_mpu, TI_AM335X_CM_CLKSEL_DPLL_MPU_DPLL_DIV); |
673 | const uint32_t m2 = __SHIFTOUT(div_m2_dpll_mpu, TI_AM335X_CM_DIV_M2_DPLL_MPU_DPLL_CLKOUT_DIV); | | 685 | const uint32_t m2 = __SHIFTOUT(div_m2_dpll_mpu, TI_AM335X_CM_DIV_M2_DPLL_MPU_DPLL_CLKOUT_DIV); |
674 | /* XXX This ignores CM_CLKSEL_DPLL_MPU[DPLL_REGM4XEN]. */ | | 686 | /* XXX This ignores CM_CLKSEL_DPLL_MPU[DPLL_REGM4XEN]. */ |
675 | curcpu()->ci_data.cpu_cc_freq = ((m * (sys_clk / (n + 1))) / m2); | | 687 | curcpu()->ci_data.cpu_cc_freq = ((m * (sys_clk / (n + 1))) / m2); |
676 | printf("%s: %"PRIu64": sys_clk=%u m=%u n=%u (%u) m2=%u\n", | | 688 | printf("%s: %"PRIu64": sys_clk=%u m=%u n=%u (%u) m2=%u\n", |
677 | __func__, curcpu()->ci_data.cpu_cc_freq, | | 689 | __func__, curcpu()->ci_data.cpu_cc_freq, |
678 | sys_clk, m, n, n+1, m2); | | 690 | sys_clk, m, n, n+1, m2); |
679 | } | | 691 | } |
680 | #endif | | 692 | #endif |
681 | | | 693 | |
682 | #if defined(OMAP_3530) || defined(OMAP_3430) | | 694 | #if defined(OMAP_3430) || defined(OMAP_3530) |
683 | #define SDRC_MCFG(p) (0x80 + (0x30 * (p))) | | 695 | #define SDRC_MCFG(p) (0x80 + (0x30 * (p))) |
684 | #define SDRC_MCFG_MEMSIZE(m) ((((m) & __BITS(8,17)) >> 8) * 2) | | 696 | #define SDRC_MCFG_MEMSIZE(m) ((((m) & __BITS(8,17)) >> 8) * 2) |
685 | static psize_t | | 697 | static psize_t |
686 | omap3530_memprobe(void) | | 698 | omap3530_memprobe(void) |
687 | { | | 699 | { |
688 | const vaddr_t gpmc_base = OMAP_SDRC_VBASE; | | 700 | const vaddr_t gpmc_base = OMAP_SDRC_VBASE; |
689 | const uint32_t mcfg0 = *(volatile uint32_t *)(gpmc_base + SDRC_MCFG(0)); | | 701 | const uint32_t mcfg0 = *(volatile uint32_t *)(gpmc_base + SDRC_MCFG(0)); |
690 | const uint32_t mcfg1 = *(volatile uint32_t *)(gpmc_base + SDRC_MCFG(1)); | | 702 | const uint32_t mcfg1 = *(volatile uint32_t *)(gpmc_base + SDRC_MCFG(1)); |
691 | | | 703 | |
692 | printf("mcfg0 = %#x, size %lld\n", mcfg0, SDRC_MCFG_MEMSIZE(mcfg0)); | | 704 | printf("mcfg0 = %#x, size %lld\n", mcfg0, SDRC_MCFG_MEMSIZE(mcfg0)); |
693 | printf("mcfg1 = %#x, size %lld\n", mcfg1, SDRC_MCFG_MEMSIZE(mcfg1)); | | 705 | printf("mcfg1 = %#x, size %lld\n", mcfg1, SDRC_MCFG_MEMSIZE(mcfg1)); |
694 | | | 706 | |
695 | return (SDRC_MCFG_MEMSIZE(mcfg0) + SDRC_MCFG_MEMSIZE(mcfg1)) * 1024 * 1024; | | 707 | return (SDRC_MCFG_MEMSIZE(mcfg0) + SDRC_MCFG_MEMSIZE(mcfg1)) * 1024 * 1024; |
| @@ -772,27 +784,27 @@ beagle_device_register(device_t self, vo | | | @@ -772,27 +784,27 @@ beagle_device_register(device_t self, vo |
772 | prop_dictionary_set_cstring(dict, "port2-mode", "none"); | | 784 | prop_dictionary_set_cstring(dict, "port2-mode", "none"); |
773 | prop_dictionary_set_bool(dict, "phy-reset", true); | | 785 | prop_dictionary_set_bool(dict, "phy-reset", true); |
774 | prop_dictionary_set_int16(dict, "port0-gpio", -1); | | 786 | prop_dictionary_set_int16(dict, "port0-gpio", -1); |
775 | prop_dictionary_set_int16(dict, "port1-gpio", 147); | | 787 | prop_dictionary_set_int16(dict, "port1-gpio", 147); |
776 | prop_dictionary_set_int16(dict, "port2-gpio", -1); | | 788 | prop_dictionary_set_int16(dict, "port2-gpio", -1); |
777 | prop_dictionary_set_uint16(dict, "dpll5-m", 443); | | 789 | prop_dictionary_set_uint16(dict, "dpll5-m", 443); |
778 | prop_dictionary_set_uint16(dict, "dpll5-n", 11); | | 790 | prop_dictionary_set_uint16(dict, "dpll5-n", 11); |
779 | prop_dictionary_set_uint16(dict, "dpll5-m2", 4); | | 791 | prop_dictionary_set_uint16(dict, "dpll5-m2", 4); |
780 | #endif | | 792 | #endif |
781 | return; | | 793 | return; |
782 | } | | 794 | } |
783 | | | 795 | |
784 | if (device_is_a(self, "sdhc")) { | | 796 | if (device_is_a(self, "sdhc")) { |
785 | #if defined(OMAP_3530) | | 797 | #if defined(OMAP_3430) || defined(OMAP_3530) |
786 | prop_dictionary_set_uint32(dict, "clkmask", 0); | | 798 | prop_dictionary_set_uint32(dict, "clkmask", 0); |
787 | prop_dictionary_set_bool(dict, "8bit", true); | | 799 | prop_dictionary_set_bool(dict, "8bit", true); |
788 | #endif | | 800 | #endif |
789 | return; | | 801 | return; |
790 | } | | 802 | } |
791 | | | 803 | |
792 | if (device_is_a(self, "omapfb")) { | | 804 | if (device_is_a(self, "omapfb")) { |
793 | if (beagle_read_edid(beagle_edid, sizeof(beagle_edid))) { | | 805 | if (beagle_read_edid(beagle_edid, sizeof(beagle_edid))) { |
794 | prop_dictionary_set(dict, "EDID", | | 806 | prop_dictionary_set(dict, "EDID", |
795 | prop_data_create_data(beagle_edid, | | 807 | prop_data_create_data(beagle_edid, |
796 | sizeof(beagle_edid))); | | 808 | sizeof(beagle_edid))); |
797 | } | | 809 | } |
798 | if (use_fb_console) | | 810 | if (use_fb_console) |