r5_mpu.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * K3: R5 MPU region definitions
  4. *
  5. * Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
  6. * Lokesh Vutla <lokeshvutla@ti.com>
  7. */
  8. #include <common.h>
  9. #include <asm/io.h>
  10. #include <linux/kernel.h>
  11. #include "common.h"
  12. struct mpu_region_config k3_mpu_regions[16] = {
  13. /*
  14. * Make all 4GB as Device Memory and not executable. We are overriding
  15. * it with next region for any requirement.
  16. */
  17. {0x00000000, REGION_0, XN_EN, PRIV_RW_USR_RW, SHARED_WRITE_BUFFERED,
  18. REGION_4GB},
  19. /* SPL code area marking it as WB and Write allocate. */
  20. {CONFIG_SPL_TEXT_BASE, REGION_1, XN_DIS, PRIV_RW_USR_RW,
  21. O_I_WB_RD_WR_ALLOC, REGION_8MB},
  22. /* U-Boot's code area marking it as WB and Write allocate */
  23. {CONFIG_SYS_SDRAM_BASE, REGION_2, XN_DIS, PRIV_RW_USR_RW,
  24. O_I_WB_RD_WR_ALLOC, REGION_2GB},
  25. {0x0, 3, 0x0, 0x0, 0x0, 0x0},
  26. {0x0, 4, 0x0, 0x0, 0x0, 0x0},
  27. {0x0, 5, 0x0, 0x0, 0x0, 0x0},
  28. {0x0, 6, 0x0, 0x0, 0x0, 0x0},
  29. {0x0, 7, 0x0, 0x0, 0x0, 0x0},
  30. {0x0, 8, 0x0, 0x0, 0x0, 0x0},
  31. {0x0, 9, 0x0, 0x0, 0x0, 0x0},
  32. {0x0, 10, 0x0, 0x0, 0x0, 0x0},
  33. {0x0, 11, 0x0, 0x0, 0x0, 0x0},
  34. {0x0, 12, 0x0, 0x0, 0x0, 0x0},
  35. {0x0, 13, 0x0, 0x0, 0x0, 0x0},
  36. {0x0, 14, 0x0, 0x0, 0x0, 0x0},
  37. {0x0, 15, 0x0, 0x0, 0x0, 0x0},
  38. };
  39. void setup_k3_mpu_regions(void)
  40. {
  41. setup_mpu_regions(k3_mpu_regions, ARRAY_SIZE(k3_mpu_regions));
  42. }