stm32.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright (C) 2016, STMicroelectronics - All Rights Reserved
  3. * Author(s): Vikas Manocha, <vikas.manocha@st.com> for STMicroelectronics.
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #ifndef _ASM_ARCH_HARDWARE_H
  8. #define _ASM_ARCH_HARDWARE_H
  9. /* STM32F746 */
  10. #define ITCM_FLASH_BASE 0x00200000UL
  11. #define AXIM_FLASH_BASE 0x08000000UL
  12. #define ITCM_SRAM_BASE 0x00000000UL
  13. #define DTCM_SRAM_BASE 0x20000000UL
  14. #define SRAM1_BASE 0x20010000UL
  15. #define SRAM2_BASE 0x2004C000UL
  16. #define PERIPH_BASE 0x40000000UL
  17. #define APB1_PERIPH_BASE (PERIPH_BASE + 0x00000000)
  18. #define APB2_PERIPH_BASE (PERIPH_BASE + 0x00010000)
  19. #define AHB1_PERIPH_BASE (PERIPH_BASE + 0x00020000)
  20. #define AHB2_PERIPH_BASE (PERIPH_BASE + 0x10000000)
  21. #define AHB3_PERIPH_BASE (PERIPH_BASE + 0x20000000)
  22. #define TIM2_BASE (APB1_PERIPH_BASE + 0x0000)
  23. #define USART2_BASE (APB1_PERIPH_BASE + 0x4400)
  24. #define USART3_BASE (APB1_PERIPH_BASE + 0x4800)
  25. #define PWR_BASE (APB1_PERIPH_BASE + 0x7000)
  26. #define USART1_BASE (APB2_PERIPH_BASE + 0x1000)
  27. #define USART6_BASE (APB2_PERIPH_BASE + 0x1400)
  28. #define STM32_SYSCFG_BASE (APB2_PERIPH_BASE + 0x3800)
  29. #define STM32_GPIOA_BASE (AHB1_PERIPH_BASE + 0x0000)
  30. #define STM32_GPIOB_BASE (AHB1_PERIPH_BASE + 0x0400)
  31. #define STM32_GPIOC_BASE (AHB1_PERIPH_BASE + 0x0800)
  32. #define STM32_GPIOD_BASE (AHB1_PERIPH_BASE + 0x0C00)
  33. #define STM32_GPIOE_BASE (AHB1_PERIPH_BASE + 0x1000)
  34. #define STM32_GPIOF_BASE (AHB1_PERIPH_BASE + 0x1400)
  35. #define STM32_GPIOG_BASE (AHB1_PERIPH_BASE + 0x1800)
  36. #define STM32_GPIOH_BASE (AHB1_PERIPH_BASE + 0x1C00)
  37. #define STM32_GPIOI_BASE (AHB1_PERIPH_BASE + 0x2000)
  38. #define STM32_GPIOJ_BASE (AHB1_PERIPH_BASE + 0x2400)
  39. #define STM32_GPIOK_BASE (AHB1_PERIPH_BASE + 0x2800)
  40. #define RCC_BASE (AHB1_PERIPH_BASE + 0x3800)
  41. #define FLASH_CNTL_BASE (AHB1_PERIPH_BASE + 0x3C00)
  42. #define SDRAM_FMC_BASE (AHB3_PERIPH_BASE + 0x40000140)
  43. static const u32 sect_sz_kb[CONFIG_SYS_MAX_FLASH_SECT] = {
  44. [0 ... 3] = 32 * 1024,
  45. [4] = 128 * 1024,
  46. [5 ... 7] = 256 * 1024
  47. };
  48. #define STM32_BUS_MASK GENMASK(31, 16)
  49. #define STM32_RCC ((struct stm32_rcc_regs *)RCC_BASE)
  50. void stm32_flash_latency_cfg(int latency);
  51. #endif /* _ASM_ARCH_HARDWARE_H */