mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-04 10:30:32 +00:00
30915ab95d
The BATs (block address translation registers) determine the initial memory window mappings. Hence, they must be known at compile time and cannot be implemented in the DT mechanism. Configuration of this crucial variable should still be somewhat comfortable. Hence, make its fields configurable in Kconfig, and assemble the final value from these. Signed-off-by: Mario Six <mario.six@gdsys.cc>
223 lines
5 KiB
C
223 lines
5 KiB
C
#ifdef CONFIG_BAT0
|
|
#define CONFIG_SYS_IBAT0L (\
|
|
(CONFIG_BAT0_BASE) |\
|
|
(CONFIG_BAT0_PAGE_PROTECTION) |\
|
|
(CONFIG_BAT0_WIMG_ICACHE) \
|
|
)
|
|
#define CONFIG_SYS_IBAT0U (\
|
|
(CONFIG_BAT0_BASE) |\
|
|
(CONFIG_BAT0_LENGTH) |\
|
|
(CONFIG_BAT0_VALID_BITS) \
|
|
)
|
|
#define CONFIG_SYS_DBAT0L (\
|
|
(CONFIG_BAT0_BASE) |\
|
|
(CONFIG_BAT0_PAGE_PROTECTION) |\
|
|
(CONFIG_BAT0_WIMG_DCACHE) \
|
|
)
|
|
#define CONFIG_SYS_DBAT0U (\
|
|
(CONFIG_BAT0_BASE) |\
|
|
(CONFIG_BAT0_LENGTH) |\
|
|
(CONFIG_BAT0_VALID_BITS) \
|
|
)
|
|
#else
|
|
#define CONFIG_SYS_IBAT0L (0)
|
|
#define CONFIG_SYS_IBAT0U (0)
|
|
#define CONFIG_SYS_DBAT0L (0)
|
|
#define CONFIG_SYS_DBAT0U (0)
|
|
#endif /* CONFIG_BAT0 */
|
|
|
|
#ifdef CONFIG_BAT1
|
|
#define CONFIG_SYS_IBAT1L (\
|
|
(CONFIG_BAT1_BASE) |\
|
|
(CONFIG_BAT1_PAGE_PROTECTION) |\
|
|
(CONFIG_BAT1_WIMG_ICACHE) \
|
|
)
|
|
#define CONFIG_SYS_IBAT1U (\
|
|
(CONFIG_BAT1_BASE) |\
|
|
(CONFIG_BAT1_LENGTH) |\
|
|
(CONFIG_BAT1_VALID_BITS) \
|
|
)
|
|
#define CONFIG_SYS_DBAT1L (\
|
|
(CONFIG_BAT1_BASE) |\
|
|
(CONFIG_BAT1_PAGE_PROTECTION) |\
|
|
(CONFIG_BAT1_WIMG_DCACHE) \
|
|
)
|
|
#define CONFIG_SYS_DBAT1U (\
|
|
(CONFIG_BAT1_BASE) |\
|
|
(CONFIG_BAT1_LENGTH) |\
|
|
(CONFIG_BAT1_VALID_BITS) \
|
|
)
|
|
#else
|
|
#define CONFIG_SYS_IBAT1L (0)
|
|
#define CONFIG_SYS_IBAT1U (0)
|
|
#define CONFIG_SYS_DBAT1L (0)
|
|
#define CONFIG_SYS_DBAT1U (0)
|
|
#endif /* CONFIG_BAT1 */
|
|
|
|
#ifdef CONFIG_BAT2
|
|
#define CONFIG_SYS_IBAT2L (\
|
|
(CONFIG_BAT2_BASE) |\
|
|
(CONFIG_BAT2_PAGE_PROTECTION) |\
|
|
(CONFIG_BAT2_WIMG_ICACHE) \
|
|
)
|
|
#define CONFIG_SYS_IBAT2U (\
|
|
(CONFIG_BAT2_BASE) |\
|
|
(CONFIG_BAT2_LENGTH) |\
|
|
(CONFIG_BAT2_VALID_BITS) \
|
|
)
|
|
#define CONFIG_SYS_DBAT2L (\
|
|
(CONFIG_BAT2_BASE) |\
|
|
(CONFIG_BAT2_PAGE_PROTECTION) |\
|
|
(CONFIG_BAT2_WIMG_DCACHE) \
|
|
)
|
|
#define CONFIG_SYS_DBAT2U (\
|
|
(CONFIG_BAT2_BASE) |\
|
|
(CONFIG_BAT2_LENGTH) |\
|
|
(CONFIG_BAT2_VALID_BITS) \
|
|
)
|
|
#else
|
|
#define CONFIG_SYS_IBAT2L (0)
|
|
#define CONFIG_SYS_IBAT2U (0)
|
|
#define CONFIG_SYS_DBAT2L (0)
|
|
#define CONFIG_SYS_DBAT2U (0)
|
|
#endif /* CONFIG_BAT2 */
|
|
|
|
#ifdef CONFIG_BAT3
|
|
#define CONFIG_SYS_IBAT3L (\
|
|
(CONFIG_BAT3_BASE) |\
|
|
(CONFIG_BAT3_PAGE_PROTECTION) |\
|
|
(CONFIG_BAT3_WIMG_ICACHE) \
|
|
)
|
|
#define CONFIG_SYS_IBAT3U (\
|
|
(CONFIG_BAT3_BASE) |\
|
|
(CONFIG_BAT3_LENGTH) |\
|
|
(CONFIG_BAT3_VALID_BITS) \
|
|
)
|
|
#define CONFIG_SYS_DBAT3L (\
|
|
(CONFIG_BAT3_BASE) |\
|
|
(CONFIG_BAT3_PAGE_PROTECTION) |\
|
|
(CONFIG_BAT3_WIMG_DCACHE) \
|
|
)
|
|
#define CONFIG_SYS_DBAT3U (\
|
|
(CONFIG_BAT3_BASE) |\
|
|
(CONFIG_BAT3_LENGTH) |\
|
|
(CONFIG_BAT3_VALID_BITS) \
|
|
)
|
|
#else
|
|
#define CONFIG_SYS_IBAT3L (0)
|
|
#define CONFIG_SYS_IBAT3U (0)
|
|
#define CONFIG_SYS_DBAT3L (0)
|
|
#define CONFIG_SYS_DBAT3U (0)
|
|
#endif /* CONFIG_BAT3 */
|
|
|
|
#ifdef CONFIG_BAT4
|
|
#define CONFIG_SYS_IBAT4L (\
|
|
(CONFIG_BAT4_BASE) |\
|
|
(CONFIG_BAT4_PAGE_PROTECTION) |\
|
|
(CONFIG_BAT4_WIMG_ICACHE) \
|
|
)
|
|
#define CONFIG_SYS_IBAT4U (\
|
|
(CONFIG_BAT4_BASE) |\
|
|
(CONFIG_BAT4_LENGTH) |\
|
|
(CONFIG_BAT4_VALID_BITS) \
|
|
)
|
|
#define CONFIG_SYS_DBAT4L (\
|
|
(CONFIG_BAT4_BASE) |\
|
|
(CONFIG_BAT4_PAGE_PROTECTION) |\
|
|
(CONFIG_BAT4_WIMG_DCACHE) \
|
|
)
|
|
#define CONFIG_SYS_DBAT4U (\
|
|
(CONFIG_BAT4_BASE) |\
|
|
(CONFIG_BAT4_LENGTH) |\
|
|
(CONFIG_BAT4_VALID_BITS) \
|
|
)
|
|
#else
|
|
#define CONFIG_SYS_IBAT4L (0)
|
|
#define CONFIG_SYS_IBAT4U (0)
|
|
#define CONFIG_SYS_DBAT4L (0)
|
|
#define CONFIG_SYS_DBAT4U (0)
|
|
#endif /* CONFIG_BAT4 */
|
|
|
|
#ifdef CONFIG_BAT5
|
|
#define CONFIG_SYS_IBAT5L (\
|
|
(CONFIG_BAT5_BASE) |\
|
|
(CONFIG_BAT5_PAGE_PROTECTION) |\
|
|
(CONFIG_BAT5_WIMG_ICACHE) \
|
|
)
|
|
#define CONFIG_SYS_IBAT5U (\
|
|
(CONFIG_BAT5_BASE) |\
|
|
(CONFIG_BAT5_LENGTH) |\
|
|
(CONFIG_BAT5_VALID_BITS) \
|
|
)
|
|
#define CONFIG_SYS_DBAT5L (\
|
|
(CONFIG_BAT5_BASE) |\
|
|
(CONFIG_BAT5_PAGE_PROTECTION) |\
|
|
(CONFIG_BAT5_WIMG_DCACHE) \
|
|
)
|
|
#define CONFIG_SYS_DBAT5U (\
|
|
(CONFIG_BAT5_BASE) |\
|
|
(CONFIG_BAT5_LENGTH) |\
|
|
(CONFIG_BAT5_VALID_BITS) \
|
|
)
|
|
#else
|
|
#define CONFIG_SYS_IBAT5L (0)
|
|
#define CONFIG_SYS_IBAT5U (0)
|
|
#define CONFIG_SYS_DBAT5L (0)
|
|
#define CONFIG_SYS_DBAT5U (0)
|
|
#endif /* CONFIG_BAT5 */
|
|
|
|
#ifdef CONFIG_BAT6
|
|
#define CONFIG_SYS_IBAT6L (\
|
|
(CONFIG_BAT6_BASE) |\
|
|
(CONFIG_BAT6_PAGE_PROTECTION) |\
|
|
(CONFIG_BAT6_WIMG_ICACHE) \
|
|
)
|
|
#define CONFIG_SYS_IBAT6U (\
|
|
(CONFIG_BAT6_BASE) |\
|
|
(CONFIG_BAT6_LENGTH) |\
|
|
(CONFIG_BAT6_VALID_BITS) \
|
|
)
|
|
#define CONFIG_SYS_DBAT6L (\
|
|
(CONFIG_BAT6_BASE) |\
|
|
(CONFIG_BAT6_PAGE_PROTECTION) |\
|
|
(CONFIG_BAT6_WIMG_DCACHE) \
|
|
)
|
|
#define CONFIG_SYS_DBAT6U (\
|
|
(CONFIG_BAT6_BASE) |\
|
|
(CONFIG_BAT6_LENGTH) |\
|
|
(CONFIG_BAT6_VALID_BITS) \
|
|
)
|
|
#else
|
|
#define CONFIG_SYS_IBAT6L (0)
|
|
#define CONFIG_SYS_IBAT6U (0)
|
|
#define CONFIG_SYS_DBAT6L (0)
|
|
#define CONFIG_SYS_DBAT6U (0)
|
|
#endif /* CONFIG_BAT6 */
|
|
|
|
#ifdef CONFIG_BAT7
|
|
#define CONFIG_SYS_IBAT7L (\
|
|
(CONFIG_BAT7_BASE) |\
|
|
(CONFIG_BAT7_PAGE_PROTECTION) |\
|
|
(CONFIG_BAT7_WIMG_ICACHE) \
|
|
)
|
|
#define CONFIG_SYS_IBAT7U (\
|
|
(CONFIG_BAT7_BASE) |\
|
|
(CONFIG_BAT7_LENGTH) |\
|
|
(CONFIG_BAT7_VALID_BITS) \
|
|
)
|
|
#define CONFIG_SYS_DBAT7L (\
|
|
(CONFIG_BAT7_BASE) |\
|
|
(CONFIG_BAT7_PAGE_PROTECTION) |\
|
|
(CONFIG_BAT7_WIMG_DCACHE) \
|
|
)
|
|
#define CONFIG_SYS_DBAT7U (\
|
|
(CONFIG_BAT7_BASE) |\
|
|
(CONFIG_BAT7_LENGTH) |\
|
|
(CONFIG_BAT7_VALID_BITS) \
|
|
)
|
|
#else
|
|
#define CONFIG_SYS_IBAT7L (0)
|
|
#define CONFIG_SYS_IBAT7U (0)
|
|
#define CONFIG_SYS_DBAT7L (0)
|
|
#define CONFIG_SYS_DBAT7U (0)
|
|
#endif /* CONFIG_BAT7 */
|