You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

97 lines
2.8 KiB

  1. /***************************************************************************
  2. * Copyright (C) 2006 by Magnus Lundin *
  3. * lundinªmlu.mine.nu *
  4. * *
  5. * This program is free software; you can redistribute it and/or modify *
  6. * it under the terms of the GNU General Public License as published by *
  7. * the Free Software Foundation; either version 2 of the License, or *
  8. * (at your option) any later version. *
  9. * *
  10. * This program is distributed in the hope that it will be useful, *
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  13. * GNU General Public License for more details. *
  14. * *
  15. * You should have received a copy of the GNU General Public License *
  16. * along with this program; if not, write to the *
  17. * Free Software Foundation, Inc., *
  18. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
  19. ***************************************************************************/
  20. #ifndef STELLARIS_FLASH_H
  21. #define STELLARIS_FLASH_H
  22. #include "flash.h"
  23. #include "target.h"
  24. typedef struct stellaris_flash_bank_s
  25. {
  26. /* chip id register */
  27. u32 did0;
  28. u32 did1;
  29. u32 dc0;
  30. u32 dc1;
  31. char * target_name;
  32. u32 sramsiz;
  33. u32 flshsz;
  34. /* flash geometry */
  35. u32 num_pages;
  36. u32 pagesize;
  37. u32 pages_in_lockregion;
  38. /* nv memory bits */
  39. u16 num_lockbits;
  40. u32 lockbits;
  41. /* main clock status */
  42. u32 rcc;
  43. u8 mck_valid;
  44. u32 mck_freq;
  45. } stellaris_flash_bank_t;
  46. /* STELLARIS control registers */
  47. #define SCB_BASE 0x400FE000
  48. #define DID0 0x000
  49. #define DID1 0x004
  50. #define DC0 0x008
  51. #define DC1 0x010
  52. #define DC2 0x014
  53. #define DC3 0x018
  54. #define DC4 0x01C
  55. #define RIS 0x050
  56. #define RCC 0x060
  57. #define PLLCFG 0x064
  58. #define FMPRE 0x130
  59. #define FMPPE 0x134
  60. #define USECRL 0x140
  61. #define FLASH_CONTROL_BASE 0x400FD000
  62. #define FLASH_FMA (FLASH_CONTROL_BASE|0x000)
  63. #define FLASH_FMD (FLASH_CONTROL_BASE|0x004)
  64. #define FLASH_FMC (FLASH_CONTROL_BASE|0x008)
  65. #define FLASH_CRIS (FLASH_CONTROL_BASE|0x00C)
  66. #define FLASH_CIM (FLASH_CONTROL_BASE|0x010)
  67. #define FLASH_MISC (FLASH_CONTROL_BASE|0x014)
  68. #define AMISC 1
  69. #define PMISC 2
  70. #define AMASK 1
  71. #define PMASK 2
  72. /* Flash Controller Command bits */
  73. #define FMC_WRKEY (0xA442<<16)
  74. #define FMC_COMT (1<<3)
  75. #define FMC_MERASE (1<<2)
  76. #define FMC_ERASE (1<<1)
  77. #define FMC_WRITE (1<<0)
  78. /* STELLARIS constants */
  79. #endif /* STELLARIS_H */