From 8c2b458d7556cda49fb1c7378f1b5fdd2d4f3d14 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 28 Jul 2014 17:09:37 -0600 Subject: [PATCH] Fixes to last SAMA5 PMIC checkin --- arch/arm/src/sama5/sam_irq.c | 8 +++++--- configs/sama5d4-ek/dramboot/defconfig | 27 ++++++++++++++++++++++++--- configs/sama5d4-ek/src/dram_main.c | 6 +++--- configs/sama5d4-ek/src/sam_pmic.c | 15 +++++---------- configs/sama5d4-ek/src/sama5d4-ek.h | 2 +- 5 files changed, 38 insertions(+), 20 deletions(-) diff --git a/arch/arm/src/sama5/sam_irq.c b/arch/arm/src/sama5/sam_irq.c index f81617e8c8..88d426ce1a 100644 --- a/arch/arm/src/sama5/sam_irq.c +++ b/arch/arm/src/sama5/sam_irq.c @@ -528,11 +528,13 @@ void up_irqinitialize(void) putreg32(AXIMX_REMAP_REMAP1, SAM_AXIMX_REMAP); /* Remap NOR FLASH on CS0 */ #endif - /* Make sure that there is no trace of any previous mapping */ + /* Make sure that there is no trace of any previous mapping (here we + * that the L2 cache has not yet been enabled. + */ vectorsize = sam_vectorsize(); - arch_invalidate_icache(); - arch_invalidate_dcache(0, vectorsize); + cp15_invalidate_icache(); + cp15_invalidate_dcache(0, vectorsize); mmu_invalidate_region(0, vectorsize); #if 0 /* Disabled on reset */ diff --git a/configs/sama5d4-ek/dramboot/defconfig b/configs/sama5d4-ek/dramboot/defconfig index 501b8966b7..bbd016d574 100644 --- a/configs/sama5d4-ek/dramboot/defconfig +++ b/configs/sama5d4-ek/dramboot/defconfig @@ -112,6 +112,12 @@ CONFIG_ARCH_LOWVECTORS=y # # ARMv7-A Configuration Options # +CONFIG_ARMV7A_HAVE_L2CC=y +CONFIG_ARMV7A_HAVE_L2CC_PL310=y + +# +# L2 Cache Configuration +# # CONFIG_ARMV7A_TOOLCHAIN_BUILDROOT is not set CONFIG_ARMV7A_TOOLCHAIN_CODESOURCERYW=y # CONFIG_ARMV7A_TOOLCHAIN_DEVKITARM is not set @@ -133,7 +139,6 @@ CONFIG_SAMA5_HAVE_USART4=y # CONFIG_SAMA5_HAVE_DMA is not set CONFIG_SAMA5_HAVE_DDR32=y CONFIG_SAMA5_HAVE_XDMA=y -CONFIG_SAMA5_HAVE_L2CC=y CONFIG_SAMA5_HAVE_LCDC=y # CONFIG_SAMA5_HAVE_GMAC is not set # CONFIG_SAMA5_HAVE_EMACA is not set @@ -168,7 +173,6 @@ CONFIG_ARCH_CHIP_ATSAMA5D44=y # CONFIG_SAMA5_TDES is not set # CONFIG_SAMA5_AESB is not set # CONFIG_SAMA5_DBGU is not set -# CONFIG_SAMA5_L2CC is not set # CONFIG_SAMA5_PIT is not set # CONFIG_SAMA5_WDT is not set # CONFIG_SAMA5_RTC is not set @@ -246,6 +250,7 @@ CONFIG_SAMA5_DDRCS_HEAP_SIZE=0 # CONFIG_ARCH_VECNOTIRQ is not set # CONFIG_ARCH_DMA is not set CONFIG_ARCH_HAVE_IRQPRIO=y +# CONFIG_ARCH_L2CACHE is not set # CONFIG_CUSTOM_STACK is not set # CONFIG_ADDRENV is not set CONFIG_ARCH_HAVE_VFORK=y @@ -317,6 +322,7 @@ CONFIG_SAMA5D4EK_MT47H128M16RT=y # CONFIG_SAMA5D4EK_MT47H64M16HR is not set CONFIG_SAMA5D4EK_DRAM_MAIN=y # CONFIG_SAMA5D4EK_DRAM_START is not set +# CONFIG_SAMA5D4EK_AT25_MAIN is not set # # RTOS Features @@ -415,11 +421,17 @@ CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set # CONFIG_LOOP is not set + +# +# Buffering +# +# CONFIG_DRVR_WRITEBUFFER is not set +# CONFIG_DRVR_READAHEAD is not set # CONFIG_RAMDISK is not set # CONFIG_CAN is not set # CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set # CONFIG_PWM is not set -# CONFIG_ARCH_HAVE_I2CRESET is not set +CONFIG_ARCH_HAVE_I2CRESET=y # CONFIG_I2C is not set # CONFIG_SPI is not set # CONFIG_I2S is not set @@ -506,6 +518,11 @@ CONFIG_USART3_2STOP=0 # CONFIG_ARCH_HAVE_PHY is not set # CONFIG_NET is not set +# +# Crypto API +# +# CONFIG_CRYPTO is not set + # # File Systems # @@ -784,6 +801,10 @@ CONFIG_READLINE_ECHO=y # P-Code Support # +# +# PHY Tool +# + # # Power Off # diff --git a/configs/sama5d4-ek/src/dram_main.c b/configs/sama5d4-ek/src/dram_main.c index 291a07050c..6c7ccf03cb 100644 --- a/configs/sama5d4-ek/src/dram_main.c +++ b/configs/sama5d4-ek/src/dram_main.c @@ -111,7 +111,7 @@ int dram_main(int argc, char *argv) * JP23 will be closed and the PMIC will be initialized. */ - sam_pmic_initialize() + sam_pmic_initialize(); /* DRAM was already initialized at boot time, so we are ready to load the * Intel HEX stream into DRAM. @@ -167,8 +167,8 @@ int dram_main(int argc, char *argv) /* Invalidate caches and TLBs */ - arch_invalidate_icache(); - arch_invalidate_dcache_all(); + cp15_invalidate_icache(); + cp15_invalidate_dcache_all(); cp15_invalidate_tlbs(); /* Then jump into NOR flash */ diff --git a/configs/sama5d4-ek/src/sam_pmic.c b/configs/sama5d4-ek/src/sam_pmic.c index c74220a0c4..c355873923 100644 --- a/configs/sama5d4-ek/src/sam_pmic.c +++ b/configs/sama5d4-ek/src/sam_pmic.c @@ -39,17 +39,12 @@ #include -#include -#include -#include -#include +#include #include +#include #include -#include - -#include "up_arch.h" #include "sam_twi.h" #include "sama5d4-ek.h" @@ -113,15 +108,15 @@ void sam_pmic_initialize(void) buffer[0] = 0x0b; buffer[1] = 0xee; - (void)I2C_SEND(i2c, buffer, 2); + (void)I2C_WRITE(i2c, buffer, 2); buffer[0] = 0x02; buffer[1] = 0x0f; - (void)I2C_SEND(i2c, buffer, 2); + (void)I2C_WRITE(i2c, buffer, 2); buffer[0] = 0x03; buffer[1] = 0x0f; - (void)I2C_SEND(i2c, buffer, 2); + (void)I2C_WRITE(i2c, buffer, 2); } } diff --git a/configs/sama5d4-ek/src/sama5d4-ek.h b/configs/sama5d4-ek/src/sama5d4-ek.h index df2403c9e2..56ac91f7ea 100644 --- a/configs/sama5d4-ek/src/sama5d4-ek.h +++ b/configs/sama5d4-ek/src/sama5d4-ek.h @@ -985,7 +985,7 @@ int sam_audio_null_initialize(int minor); ****************************************************************************/ #ifdef HAVE_PMIC -void sam_pmic_initialize(void) +void sam_pmic_initialize(void); #else # define sam_pmic_initialize() #endif