rte_nb85e_cb.c 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * arch/v850/kernel/rte_nb85e_cb.c -- Midas labs RTE-V850E/NB85E-CB board
  3. *
  4. * Copyright (C) 2001,02,03 NEC Electronics Corporation
  5. * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org>
  6. *
  7. * This file is subject to the terms and conditions of the GNU General
  8. * Public License. See the file COPYING in the main directory of this
  9. * archive for more details.
  10. *
  11. * Written by Miles Bader <miles@gnu.org>
  12. */
  13. #include <linux/config.h>
  14. #include <linux/kernel.h>
  15. #include <linux/init.h>
  16. #include <linux/mm.h>
  17. #include <linux/swap.h>
  18. #include <linux/bootmem.h>
  19. #include <linux/irq.h>
  20. #include <asm/atomic.h>
  21. #include <asm/page.h>
  22. #include <asm/v850e.h>
  23. #include <asm/rte_nb85e_cb.h>
  24. #include "mach.h"
  25. void __init mach_early_init (void)
  26. {
  27. /* Configure caching; some possible settings:
  28. BHC = 0x0000, DCC = 0x0000 -- all caching disabled
  29. BHC = 0x0040, DCC = 0x0000 -- SDRAM: icache only
  30. BHC = 0x0080, DCC = 0x0C00 -- SDRAM: write-back dcache only
  31. BHC = 0x00C0, DCC = 0x0C00 -- SDRAM: icache + write-back dcache
  32. BHC = 0x00C0, DCC = 0x0800 -- SDRAM: icache + write-thru dcache
  33. We can only cache SDRAM (we can't use cache SRAM because it's in
  34. the same memory region as the on-chip RAM and I/O space).
  35. Unfortunately, the dcache seems to be buggy, so we only use the
  36. icache for now. */
  37. v850e_cache_enable (0x0040 /*BHC*/, 0x0003 /*ICC*/, 0x0000 /*DCC*/);
  38. rte_cb_early_init ();
  39. }
  40. void __init mach_get_physical_ram (unsigned long *ram_start,
  41. unsigned long *ram_len)
  42. {
  43. /* We just use SDRAM here. */
  44. *ram_start = SDRAM_ADDR;
  45. *ram_len = SDRAM_SIZE;
  46. }
  47. void mach_gettimeofday (struct timespec *tv)
  48. {
  49. tv->tv_sec = 0;
  50. tv->tv_nsec = 0;
  51. }
  52. /* Called before configuring an on-chip UART. */
  53. void rte_nb85e_cb_uart_pre_configure (unsigned chan,
  54. unsigned cflags, unsigned baud)
  55. {
  56. /* The RTE-NB85E-CB connects some general-purpose I/O pins on the
  57. CPU to the RTS/CTS lines the UART's serial connection, as follows:
  58. P00 = CTS (in), P01 = DSR (in), P02 = RTS (out), P03 = DTR (out). */
  59. TEG_PORT0_PM = 0x03; /* P00 and P01 inputs, P02 and P03 outputs */
  60. TEG_PORT0_IO = 0x03; /* Accept input */
  61. /* Do pre-configuration for the actual UART. */
  62. teg_uart_pre_configure (chan, cflags, baud);
  63. }
  64. void __init mach_init_irqs (void)
  65. {
  66. teg_init_irqs ();
  67. rte_cb_init_irqs ();
  68. }