Vikas Manocha | 1b51c93 | 2016-02-11 15:47:20 -0800 | [diff] [blame] | 1 | /* |
Patrice Chotard | 789ee0e | 2017-10-23 09:53:58 +0200 | [diff] [blame] | 2 | * Copyright (C) 2016, STMicroelectronics - All Rights Reserved |
| 3 | * Author(s): Vikas Manocha, <vikas.manocha@st.com> for STMicroelectronics. |
Vikas Manocha | 1b51c93 | 2016-02-11 15:47:20 -0800 | [diff] [blame] | 4 | * |
| 5 | * SPDX-License-Identifier: GPL-2.0+ |
| 6 | */ |
| 7 | |
| 8 | #ifndef _ASM_ARCH_HARDWARE_H |
| 9 | #define _ASM_ARCH_HARDWARE_H |
| 10 | |
| 11 | /* STM32F746 */ |
| 12 | #define ITCM_FLASH_BASE 0x00200000UL |
| 13 | #define AXIM_FLASH_BASE 0x08000000UL |
| 14 | |
| 15 | #define ITCM_SRAM_BASE 0x00000000UL |
| 16 | #define DTCM_SRAM_BASE 0x20000000UL |
| 17 | #define SRAM1_BASE 0x20010000UL |
| 18 | #define SRAM2_BASE 0x2004C000UL |
| 19 | |
| 20 | #define PERIPH_BASE 0x40000000UL |
| 21 | |
| 22 | #define APB1_PERIPH_BASE (PERIPH_BASE + 0x00000000) |
| 23 | #define APB2_PERIPH_BASE (PERIPH_BASE + 0x00010000) |
| 24 | #define AHB1_PERIPH_BASE (PERIPH_BASE + 0x00020000) |
| 25 | #define AHB2_PERIPH_BASE (PERIPH_BASE + 0x10000000) |
| 26 | #define AHB3_PERIPH_BASE (PERIPH_BASE + 0x20000000) |
| 27 | |
| 28 | #define TIM2_BASE (APB1_PERIPH_BASE + 0x0000) |
| 29 | #define USART2_BASE (APB1_PERIPH_BASE + 0x4400) |
| 30 | #define USART3_BASE (APB1_PERIPH_BASE + 0x4800) |
| 31 | #define PWR_BASE (APB1_PERIPH_BASE + 0x7000) |
| 32 | |
| 33 | #define USART1_BASE (APB2_PERIPH_BASE + 0x1000) |
| 34 | #define USART6_BASE (APB2_PERIPH_BASE + 0x1400) |
Michael Kurz | c204fb7 | 2017-01-22 16:04:24 +0100 | [diff] [blame] | 35 | #define STM32_SYSCFG_BASE (APB2_PERIPH_BASE + 0x3800) |
Vikas Manocha | 1b51c93 | 2016-02-11 15:47:20 -0800 | [diff] [blame] | 36 | |
| 37 | #define STM32_GPIOA_BASE (AHB1_PERIPH_BASE + 0x0000) |
| 38 | #define STM32_GPIOB_BASE (AHB1_PERIPH_BASE + 0x0400) |
| 39 | #define STM32_GPIOC_BASE (AHB1_PERIPH_BASE + 0x0800) |
| 40 | #define STM32_GPIOD_BASE (AHB1_PERIPH_BASE + 0x0C00) |
| 41 | #define STM32_GPIOE_BASE (AHB1_PERIPH_BASE + 0x1000) |
| 42 | #define STM32_GPIOF_BASE (AHB1_PERIPH_BASE + 0x1400) |
| 43 | #define STM32_GPIOG_BASE (AHB1_PERIPH_BASE + 0x1800) |
| 44 | #define STM32_GPIOH_BASE (AHB1_PERIPH_BASE + 0x1C00) |
| 45 | #define STM32_GPIOI_BASE (AHB1_PERIPH_BASE + 0x2000) |
| 46 | #define STM32_GPIOJ_BASE (AHB1_PERIPH_BASE + 0x2400) |
| 47 | #define STM32_GPIOK_BASE (AHB1_PERIPH_BASE + 0x2800) |
| 48 | #define RCC_BASE (AHB1_PERIPH_BASE + 0x3800) |
| 49 | #define FLASH_CNTL_BASE (AHB1_PERIPH_BASE + 0x3C00) |
| 50 | |
| 51 | |
Michael Kurz | 115cb82 | 2017-01-22 16:04:25 +0100 | [diff] [blame] | 52 | #define SDRAM_FMC_BASE (AHB3_PERIPH_BASE + 0x40000140) |
Vikas Manocha | 1b51c93 | 2016-02-11 15:47:20 -0800 | [diff] [blame] | 53 | |
Vikas Manocha | 4940802 | 2016-03-09 15:18:14 -0800 | [diff] [blame] | 54 | static const u32 sect_sz_kb[CONFIG_SYS_MAX_FLASH_SECT] = { |
| 55 | [0 ... 3] = 32 * 1024, |
| 56 | [4] = 128 * 1024, |
| 57 | [5 ... 7] = 256 * 1024 |
| 58 | }; |
| 59 | |
Michael Kurz | c204fb7 | 2017-01-22 16:04:24 +0100 | [diff] [blame] | 60 | #define STM32_BUS_MASK GENMASK(31, 16) |
Vikas Manocha | 1b51c93 | 2016-02-11 15:47:20 -0800 | [diff] [blame] | 61 | |
Toshifumi NISHINAGA | 65bfb9c | 2016-07-08 01:02:24 +0900 | [diff] [blame] | 62 | #define STM32_RCC ((struct stm32_rcc_regs *)RCC_BASE) |
| 63 | |
Toshifumi NISHINAGA | 65bfb9c | 2016-07-08 01:02:24 +0900 | [diff] [blame] | 64 | |
Toshifumi NISHINAGA | 65bfb9c | 2016-07-08 01:02:24 +0900 | [diff] [blame] | 65 | void stm32_flash_latency_cfg(int latency); |
Vikas Manocha | 1b51c93 | 2016-02-11 15:47:20 -0800 | [diff] [blame] | 66 | |
| 67 | #endif /* _ASM_ARCH_HARDWARE_H */ |