nanoengine.c
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * linux/arch/arm/mach-sa1100/nanoengine.c
  3.  */
  4. #include <linux/init.h>
  5. #include <linux/kernel.h>
  6. #include <linux/tty.h>
  7. #include <asm/hardware.h>
  8. #include <asm/setup.h>
  9. #include <asm/mach/arch.h>
  10. #include <asm/mach/map.h>
  11. #include <asm/mach/serial_sa1100.h>
  12. #include "generic.h"
  13. static void __init
  14. fixup_nanoengine(struct machine_desc *desc, struct param_struct *params,
  15.  char **cmdline, struct meminfo *mi)
  16. {
  17. SET_BANK( 0, 0xc0000000, 32*1024*1024 );
  18. mi->nr_banks = 1;
  19. ROOT_DEV = MKDEV(RAMDISK_MAJOR,0);
  20. setup_ramdisk( 1, 0, 0, 8192 );
  21. setup_initrd( __phys_to_virt(0xc0800000), 4*1024*1024 );
  22. /* Get command line parameters passed from the loader (if any) */
  23. if( *((char*)0xc0000100) )
  24. *cmdline = ((char *)0xc0000100);
  25. }
  26. static struct map_desc nanoengine_io_desc[] __initdata = {
  27.  /* virtual     physical    length      domain     r  w  c  b */
  28.   { 0xe8000000, 0x00000000, 0x02000000, DOMAIN_IO, 0, 1, 0, 0 }, /* Flash bank 0 */
  29.   { 0xf0000000, 0x10000000, 0x00100000, DOMAIN_IO, 0, 1, 0, 0 }, /* System Registers */
  30.   { 0xf1000000, 0x18A00000, 0x00100000, DOMAIN_IO, 0, 1, 0, 0 }, /* Internal PCI Config Space */
  31.   LAST_DESC
  32. };
  33. static void __init nanoengine_map_io(void)
  34. {
  35. sa1100_map_io();
  36. iotable_init(nanoengine_io_desc);
  37. sa1100_register_uart(0, 1);
  38. sa1100_register_uart(1, 2);
  39. sa1100_register_uart(2, 3);
  40. Ser1SDCR0 |= SDCR0_UART;
  41. /* disable IRDA -- UART2 is used as a normal serial port */
  42. Ser2UTCR4=0;
  43. Ser2HSCR0 = 0;
  44. }
  45. MACHINE_START(NANOENGINE, "BSE nanoEngine")
  46. BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
  47. FIXUP(fixup_nanoengine)
  48. MAPIO(nanoengine_map_io)
  49. INITIRQ(sa1100_init_irq)
  50. MACHINE_END