Commit 45ad2442 authored by Gerson Fernando Budke's avatar Gerson Fernando Budke Committed by Carles Cufi
Browse files

soc: atmel: Enable platform specific init

This replace pre kernel initialization by the platform specific
initialization call. The platform specific init will configure
at very beginning the clocks, flash wait states and cache.

Signed-off-by: default avatarGerson Fernando Budke <nandojve@gmail.com>
parent 5457c2d7
Loading
Loading
Loading
Loading
+1 −0
Changes for soc/arm/atmel_sam/sam3x/Kconfig.series: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ config SOC_SERIES_SAM3X
	select CPU_CORTEX_M_HAS_DWT
	select CPU_HAS_ARM_MPU
	select SOC_FAMILY_SAM
	select PLATFORM_SPECIFIC_INIT
	select ASF
	help
	  Enable support for Atmel SAM3X Cortex-M3 microcontrollers.
+2 −13
Changes for soc/arm/atmel_sam/sam3x/soc.c: 2 added lines, 13 removed lines.
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2015 Wind River Systems, Inc.
 * Copyright (c) 2016 Intel Corporation.
 * Copyright (c) 2023 Gerson Fernando Budke <nandojve@gmail.com>
 *
 * SPDX-License-Identifier: Apache-2.0
 */
@@ -192,15 +193,7 @@ static ALWAYS_INLINE void clock_init(void)
	}
}

/**
 * @brief Perform basic hardware initialization at boot.
 *
 * This has to be run at the very beginning thus the init priority is set at
 * 0 (zero).
 *
 * @return 0
 */
static int atmel_sam3x_init(void)
void z_arm_platform_init(void)
{
	/*
	 * Set FWS (Flash Wait State) value before increasing Master Clock
@@ -213,8 +206,4 @@ static int atmel_sam3x_init(void)

	/* Setup system clocks */
	clock_init();

	return 0;
}

SYS_INIT(atmel_sam3x_init, PRE_KERNEL_1, 0);
+2 −1
Changes for soc/arm/atmel_sam/sam4e/Kconfig.series: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@

# Copyright (c) 2017 Justin Watson
# Copyright (c) 2018 Vincent van der Locht
# Copyright (c) 2019-2020 Gerson Fernando Budke <nandojve@gmail.com>
# Copyright (c) 2019-2023 Gerson Fernando Budke <nandojve@gmail.com>
# SPDX-License-Identifier: Apache-2.0

config SOC_SERIES_SAM4E
@@ -13,6 +13,7 @@ config SOC_SERIES_SAM4E
	select CPU_HAS_ARM_MPU
	select CPU_HAS_FPU
	select SOC_FAMILY_SAM
	select PLATFORM_SPECIFIC_INIT
	select ASF
	help
	  Enable support for Atmel SAM4E Cortex-M4 microcontrollers.
+2 −14
Changes for soc/arm/atmel_sam/sam4e/soc.c: 2 added lines, 14 removed lines.
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
 * Copyright (c) 2013-2015 Wind River Systems, Inc.
 * Copyright (c) 2016 Intel Corporation.
 * Copyright (c) 2017 Justin Watson
 * Copyright (c) 2019 Gerson Fernando Budke
 * Copyright (c) 2019-2023 Gerson Fernando Budke <nandojve@gmail.com>
 *
 * SPDX-License-Identifier: Apache-2.0
 */
@@ -180,15 +180,7 @@ static ALWAYS_INLINE void clock_init(void)
	}
}

/**
 * @brief Perform basic hardware initialization at boot.
 *
 * This needs to be run from the very beginning.
 * So the init priority has to be 0 (zero).
 *
 * @return 0
 */
static int atmel_sam4e_init(void)
void z_arm_platform_init(void)
{
	/*
	 * Set FWS (Flash Wait State) value before increasing Master Clock
@@ -202,8 +194,4 @@ static int atmel_sam4e_init(void)

	/* Setup system clocks. */
	clock_init();

	return 0;
}

SYS_INIT(atmel_sam4e_init, PRE_KERNEL_1, 0);
+2 −1
Changes for soc/arm/atmel_sam/sam4l/Kconfig.series: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
# Copyright (c) 2020 Gerson Fernando Budke <nandojve@gmail.com>
# Copyright (c) 2020-2023 Gerson Fernando Budke <nandojve@gmail.com>
# SPDX-License-Identifier: Apache-2.0

config SOC_SERIES_SAM4L
@@ -8,6 +8,7 @@ config SOC_SERIES_SAM4L
	select CPU_CORTEX_M_HAS_DWT
	select CPU_HAS_ARM_MPU
	select SOC_FAMILY_SAM
	select PLATFORM_SPECIFIC_INIT
	select ASF
	help
	  Enable support for Atmel SAM4L Cortex-M4 microcontrollers.
Loading