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.
 
 
 
 
 
 

100 lines
3.0 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. typedef struct stellaris_flash_bank_s
  24. {
  25. /* chip id register */
  26. uint32_t did0;
  27. uint32_t did1;
  28. uint32_t dc0;
  29. uint32_t dc1;
  30. char * target_name;
  31. uint32_t sramsiz;
  32. uint32_t flshsz;
  33. /* flash geometry */
  34. uint32_t num_pages;
  35. uint32_t pagesize;
  36. uint32_t pages_in_lockregion;
  37. /* nv memory bits */
  38. uint16_t num_lockbits;
  39. uint32_t lockbits;
  40. /* main clock status */
  41. uint32_t rcc;
  42. uint32_t rcc2;
  43. uint8_t mck_valid;
  44. uint8_t xtal_mask;
  45. uint32_t iosc_freq;
  46. uint32_t mck_freq;
  47. const char *iosc_desc;
  48. const char *mck_desc;
  49. } stellaris_flash_bank_t;
  50. /* STELLARIS control registers */
  51. #define SCB_BASE 0x400FE000
  52. #define DID0 0x000
  53. #define DID1 0x004
  54. #define DC0 0x008
  55. #define DC1 0x010
  56. #define DC2 0x014
  57. #define DC3 0x018
  58. #define DC4 0x01C
  59. #define RIS 0x050
  60. #define RCC 0x060
  61. #define PLLCFG 0x064
  62. #define RCC2 0x070
  63. #define FMPRE 0x130
  64. #define FMPPE 0x134
  65. #define USECRL 0x140
  66. #define FLASH_CONTROL_BASE 0x400FD000
  67. #define FLASH_FMA (FLASH_CONTROL_BASE | 0x000)
  68. #define FLASH_FMD (FLASH_CONTROL_BASE | 0x004)
  69. #define FLASH_FMC (FLASH_CONTROL_BASE | 0x008)
  70. #define FLASH_CRIS (FLASH_CONTROL_BASE | 0x00C)
  71. #define FLASH_CIM (FLASH_CONTROL_BASE | 0x010)
  72. #define FLASH_MISC (FLASH_CONTROL_BASE | 0x014)
  73. #define AMISC 1
  74. #define PMISC 2
  75. #define AMASK 1
  76. #define PMASK 2
  77. /* Flash Controller Command bits */
  78. #define FMC_WRKEY (0xA442 << 16)
  79. #define FMC_COMT (1 << 3)
  80. #define FMC_MERASE (1 << 2)
  81. #define FMC_ERASE (1 << 1)
  82. #define FMC_WRITE (1 << 0)
  83. /* STELLARIS constants */
  84. #endif /* STELLARIS_H */