Code refactor for ARM bsp MMU initialization
Sebastian Huber
sebastian.huber at embedded-brains.de
Wed Jul 8 12:59:12 UTC 2015
Hello Rohini,
please use git format-patch to generate the patches.
On 08/07/15 14:44, Rohini Kulkarni wrote:
> +++ b/c/src/lib/libbsp/arm/raspberrypi/startup/bspstartmmu.c
> @@ -0,0 +1,30 @@
> +#define ARM_CP15_TEXT_SECTION BSP_START_TEXT_SECTION
> +
> +#include <bsp/start.h>
> +#include <bsp/arm-cp15-start.h>
> +#include <bsp/linker-symbols.h>
> +#include <libcpu/arm-cp15.h>
> +#include <bsp/mm.h>
> +#include <bsp.h>
> +
> +uint32_t bsp_initial_mmu_ctrl_set;
> +uint32_t bsp_initial_mmu_ctrl_clear;
> +uint32_t domain_set;
> +
> +void raspberrypi_setup_mmu_and_cache(void)
> +{
> +#if (BSP_IS_RPI2 == 1)
> + /* Enable SMP in auxiliary control */
> + uint32_t actlr = arm_cp15_get_auxiliary_control();
> + actlr |= ARM_CORTEX_A9_ACTL_SMP;
> + arm_cp15_set_auxiliary_control(actlr);
> + bsp_initial_mmu_ctrl_clear = ARM_CP15_CTRL_A;
> + bsp_initial_mmu_ctrl_set = ARM_CP15_CTRL_AFE | ARM_CP15_CTRL_Z;
> +#else
> + bsp_initial_mmu_ctrl_clear = 0;
> + bsp_initial_mmu_ctrl_set = ARM_CP15_CTRL_AFE | ARM_CP15_CTRL_S |
> ARM_CP15_CTRL_XP;
> +#endif
> + domain_set = ARM_MMU_DEFAULT_CLIENT_DOMAIN;
> +
> + bsp_memory_management_initialize();
> +}
Is there a reason, why you use global variables instead of function
parameters?
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber at embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
More information about the devel
mailing list