head.S 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* Boot entry point for a compressed MN10300 kernel
  2. *
  3. * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. .section .text
  12. #define DEBUG
  13. #include <linux/linkage.h>
  14. #include <asm/cpu-regs.h>
  15. .globl startup_32
  16. startup_32:
  17. # first save off parameters from bootloader
  18. mov param_save_area,a0
  19. mov d0,(a0)
  20. mov d1,(4,a0)
  21. mov d2,(8,a0)
  22. mov sp,a3
  23. mov decomp_stack+0x2000-4,a0
  24. mov a0,sp
  25. # invalidate and enable both of the caches
  26. mov CHCTR,a0
  27. clr d0
  28. movhu d0,(a0) # turn off first
  29. mov CHCTR_ICINV|CHCTR_DCINV,d0
  30. movhu d0,(a0)
  31. setlb
  32. mov (a0),d0
  33. btst CHCTR_ICBUSY|CHCTR_DCBUSY,d0 # wait till not busy
  34. lne
  35. mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD,d0 # writethru dcache
  36. movhu d0,(a0) # enable
  37. # clear the BSS area
  38. mov __bss_start,a0
  39. mov _end,a1
  40. clr d0
  41. bssclear:
  42. cmp a1,a0
  43. bge bssclear_end
  44. movbu d0,(a0)
  45. inc a0
  46. bra bssclear
  47. bssclear_end:
  48. # decompress the kernel
  49. call decompress_kernel[],0
  50. # disable caches again
  51. mov CHCTR,a0
  52. clr d0
  53. movhu d0,(a0)
  54. setlb
  55. mov (a0),d0
  56. btst CHCTR_ICBUSY|CHCTR_DCBUSY,d0 # wait till not busy
  57. lne
  58. mov param_save_area,a0
  59. mov (a0),d0
  60. mov (4,a0),d1
  61. mov (8,a0),d2
  62. mov a3,sp
  63. mov CONFIG_KERNEL_TEXT_ADDRESS,a0
  64. jmp (a0)
  65. .data
  66. .align 4
  67. param_save_area:
  68. .rept 3
  69. .word 0
  70. .endr
  71. .section .bss
  72. .align 4
  73. decomp_stack:
  74. .space 0x2000