reg_nand.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*****************************************************************************
  2. * Copyright 2001 - 2008 Broadcom Corporation. All rights reserved.
  3. *
  4. * Unless you and Broadcom execute a separate written software license
  5. * agreement governing use of this software, this software is licensed to you
  6. * under the terms of the GNU General Public License version 2, available at
  7. * http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
  8. *
  9. * Notwithstanding the above, under no circumstances may you combine this
  10. * software in any way with any other Broadcom software provided under a
  11. * license other than the GPL, without Broadcom's express prior written
  12. * consent.
  13. *****************************************************************************/
  14. /*
  15. *
  16. *****************************************************************************
  17. *
  18. * REG_NAND.h
  19. *
  20. * PURPOSE:
  21. *
  22. * This file contains definitions for the nand registers:
  23. *
  24. * NOTES:
  25. *
  26. *****************************************************************************/
  27. #if !defined(__ASM_ARCH_REG_NAND_H)
  28. #define __ASM_ARCH_REG_NAND_H
  29. /* ---- Include Files ---------------------------------------------------- */
  30. #include <csp/reg.h>
  31. #include <mach/reg_umi.h>
  32. /* ---- Constants and Types ---------------------------------------------- */
  33. #define HW_NAND_BASE MM_IO_BASE_NAND /* NAND Flash */
  34. /* DMA accesses by the bootstrap need hard nonvirtual addresses */
  35. #define REG_NAND_CMD __REG16(HW_NAND_BASE + 0)
  36. #define REG_NAND_ADDR __REG16(HW_NAND_BASE + 4)
  37. #define REG_NAND_PHYS_DATA16 (HW_NAND_BASE + 8)
  38. #define REG_NAND_PHYS_DATA8 (HW_NAND_BASE + 8)
  39. #define REG_NAND_DATA16 __REG16(REG_NAND_PHYS_DATA16)
  40. #define REG_NAND_DATA8 __REG8(REG_NAND_PHYS_DATA8)
  41. /* use appropriate offset to make sure it start at the 1K boundary */
  42. #define REG_NAND_PHYS_DATA_DMA (HW_NAND_BASE + 0x400)
  43. #define REG_NAND_DATA_DMA __REG32(REG_NAND_PHYS_DATA_DMA)
  44. /* Linux DMA requires physical address of the data register */
  45. #define REG_NAND_DATA16_PADDR HW_IO_VIRT_TO_PHYS(REG_NAND_PHYS_DATA16)
  46. #define REG_NAND_DATA8_PADDR HW_IO_VIRT_TO_PHYS(REG_NAND_PHYS_DATA8)
  47. #define REG_NAND_DATA_PADDR HW_IO_VIRT_TO_PHYS(REG_NAND_PHYS_DATA_DMA)
  48. #define NAND_BUS_16BIT() (0)
  49. #define NAND_BUS_8BIT() (!NAND_BUS_16BIT())
  50. /* Register offsets */
  51. #define REG_NAND_CMD_OFFSET (0)
  52. #define REG_NAND_ADDR_OFFSET (4)
  53. #define REG_NAND_DATA8_OFFSET (8)
  54. #endif