ecc.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (c) 2008 Nuovation System Designs, LLC
  3. * Grant Erickson <gerickson@nuovations.com>
  4. *
  5. * Copyright (c) 2007-2009 DENX Software Engineering, GmbH
  6. * Stefan Roese <sr@denx.de>
  7. *
  8. * SPDX-License-Identifier: GPL-2.0+
  9. *
  10. * Description:
  11. * This file implements ECC initialization for PowerPC processors
  12. * using the IBM SDRAM DDR1 & DDR2 controller.
  13. */
  14. #ifndef _ECC_H_
  15. #define _ECC_H_
  16. /*
  17. * Since the IBM DDR controller used on 440GP/GX/EP/GR is not register
  18. * compatible to the IBM DDR/2 controller used on 405EX/440SP/SPe/460EX/GT
  19. * we need to make some processor dependant defines used later on by the
  20. * driver.
  21. */
  22. /* For 440GP/GX/EP/GR */
  23. #if defined(CONFIG_SDRAM_PPC4xx_IBM_DDR)
  24. #define SDRAM_MCOPT1 SDRAM_CFG0
  25. #define SDRAM_MCOPT1_MCHK_MASK SDRAM_CFG0_MCHK_MASK
  26. #define SDRAM_MCOPT1_MCHK_NON SDRAM_CFG0_MCHK_NON
  27. #define SDRAM_MCOPT1_MCHK_GEN SDRAM_CFG0_MCHK_GEN
  28. #define SDRAM_MCOPT1_MCHK_CHK SDRAM_CFG0_MCHK_CHK
  29. #define SDRAM_MCOPT1_MCHK_CHK_REP SDRAM_CFG0_MCHK_CHK
  30. #define SDRAM_MCOPT1_DMWD_MASK SDRAM_CFG0_DMWD_MASK
  31. #define SDRAM_MCOPT1_DMWD_32 SDRAM_CFG0_DMWD_32
  32. #define SDRAM_MCSTAT SDRAM0_MCSTS
  33. #define SDRAM_MCSTAT_IDLE_MASK SDRAM_MCSTS_CIS
  34. #define SDRAM_MCSTAT_IDLE_NOT SDRAM_MCSTS_IDLE_NOT
  35. #define SDRAM_ECCES SDRAM0_ECCESR
  36. #endif
  37. void ecc_init(unsigned long * const start, unsigned long size);
  38. void do_program_ecc(unsigned long tlb_word2_i_value);
  39. static void inline blank_string(int size)
  40. {
  41. int i;
  42. for (i = 0; i < size; i++)
  43. putc('\b');
  44. for (i = 0; i < size; i++)
  45. putc(' ');
  46. for (i = 0; i < size; i++)
  47. putc('\b');
  48. }
  49. #endif /* _ECC_H_ */