vf6xx: initial add of Vybrid VF6xx support
Freescale Vybrid is a familiy of ARM SoC, wheras the VF6xx models have two cores in one SoC, a Cortex-A5 and a Cortex-M4. This adds initial support for the Cortex-M4 in the libopencm3 library. By using two different ram areas (pc_ram and ps_ram) the user can put the code in a RAM area bounded to the code bus. The data can be stored in the data area. However, currently the initial values of for the variables in the data section are stored in the code section and copied to the ram section by the initialization code (like it's copied from ROM to RAM on microcontrollers).
This commit is contained in:
parent
cd6b997a67
commit
07b7d3e805
3
Makefile
3
Makefile
@ -37,7 +37,8 @@ SRCLIBDIR:= $(subst $(space),\$(space),$(realpath lib))
|
||||
TARGETS:= stm32/f0 stm32/f1 stm32/f2 stm32/f3 stm32/f4 stm32/l1 lpc13xx lpc17xx \
|
||||
lpc43xx/m4 lpc43xx/m0 lm3s lm4f \
|
||||
efm32/efm32tg efm32/efm32g efm32/efm32lg efm32/efm32gg \
|
||||
sam/3a sam/3n sam/3s sam/3u sam/3x
|
||||
sam/3a sam/3n sam/3s sam/3u sam/3x \
|
||||
vf6xx
|
||||
|
||||
# Be silent per default, but 'make V=1' will show all compiler calls.
|
||||
ifneq ($(V),1)
|
||||
|
@ -44,6 +44,9 @@
|
||||
/* Yes, we use the same interrupt table for both LM3S and LM4F */
|
||||
# include <libopencm3/lm3s/nvic.h>
|
||||
|
||||
#elif defined(VF6XX)
|
||||
# include <libopencm3/vf6xx/nvic.h>
|
||||
|
||||
#else
|
||||
# warning"no interrupts defined for chipset; NVIC_IRQ_COUNT = 0"
|
||||
|
||||
|
119
include/libopencm3/vf6xx/irq.json
Normal file
119
include/libopencm3/vf6xx/irq.json
Normal file
@ -0,0 +1,119 @@
|
||||
{
|
||||
"irqs": [
|
||||
"cpu2cpu_int0",
|
||||
"cpu2cpu_int1",
|
||||
"cpu2cpu_int2",
|
||||
"cpu2cpu_int3",
|
||||
"directed0_sema4",
|
||||
"directed1_mcm",
|
||||
"directed2",
|
||||
"directed3",
|
||||
"dma0",
|
||||
"dma0_error",
|
||||
"dma1",
|
||||
"dma1_error",
|
||||
"reserved0",
|
||||
"reserved1",
|
||||
"mscm_ecc0",
|
||||
"mscm_ecc1",
|
||||
"csu_alarm",
|
||||
"reserved2",
|
||||
"mscm_actzs",
|
||||
"reserved3",
|
||||
"wdog_a5",
|
||||
"wdog_m4",
|
||||
"wdog_snvs",
|
||||
"cp1_boot_fail",
|
||||
"qspi0",
|
||||
"qspi1",
|
||||
"ddrmc",
|
||||
"sdhc0",
|
||||
"sdhc1",
|
||||
"reserved4",
|
||||
"dcu0",
|
||||
"dcu1",
|
||||
"viu",
|
||||
"reserved5",
|
||||
"reserved6",
|
||||
"rle",
|
||||
"seg_lcd",
|
||||
"reserved7",
|
||||
"reserved8",
|
||||
"pit",
|
||||
"lptimer0",
|
||||
"reserved9",
|
||||
"flextimer0",
|
||||
"flextimer1",
|
||||
"flextimer2",
|
||||
"flextimer3",
|
||||
"reserved10",
|
||||
"reserved11",
|
||||
"reserved12",
|
||||
"reserved13",
|
||||
"usbphy0",
|
||||
"usbphy1",
|
||||
"reserved14",
|
||||
"adc0",
|
||||
"adc1",
|
||||
"dac0",
|
||||
"dac1",
|
||||
"reserved15",
|
||||
"flexcan0",
|
||||
"flexcan1",
|
||||
"reserved16",
|
||||
"uart0",
|
||||
"uart1",
|
||||
"uart2",
|
||||
"uart3",
|
||||
"uart4",
|
||||
"uart5",
|
||||
"spi0",
|
||||
"spi1",
|
||||
"spi2",
|
||||
"spi3",
|
||||
"i2c0",
|
||||
"i2c1",
|
||||
"i2c2",
|
||||
"i2c3",
|
||||
"usbc0",
|
||||
"usbc1",
|
||||
"reserved17",
|
||||
"enet0",
|
||||
"enet1",
|
||||
"enet0_1588",
|
||||
"enet1_1588",
|
||||
"enet_switch",
|
||||
"nfc",
|
||||
"sai0",
|
||||
"sai1",
|
||||
"sai2",
|
||||
"sai3",
|
||||
"esai_bififo",
|
||||
"spdif",
|
||||
"asrc",
|
||||
"vreg",
|
||||
"wkpu0",
|
||||
"reserved18",
|
||||
"ccm_fxosc",
|
||||
"ccm",
|
||||
"src",
|
||||
"pdb",
|
||||
"ewm",
|
||||
"reserved19",
|
||||
"reserved20",
|
||||
"reserved21",
|
||||
"reserved22",
|
||||
"reserved23",
|
||||
"reserved24",
|
||||
"reserved25",
|
||||
"reserved26",
|
||||
"gpio0",
|
||||
"gpio1",
|
||||
"gpio2",
|
||||
"gpio3",
|
||||
"gpio4"
|
||||
],
|
||||
"partname_humanreadable": "VF6xx series",
|
||||
"partname_doxygen": "VF6XX",
|
||||
"includeguard": "LIBOPENCM3_VF6XX_NVIC_H"
|
||||
}
|
@ -4,6 +4,8 @@
|
||||
# include "../stm32/f4/vector_chipset.c"
|
||||
#elif defined(LPC43XX_M4)
|
||||
# include "../lpc43xx/m4/vector_chipset.c"
|
||||
#elif defined(VF6XX)
|
||||
# include "../vf6xx/vector_chipset.c"
|
||||
|
||||
#else
|
||||
|
||||
|
@ -40,6 +40,9 @@
|
||||
#elif defined(SAM3X)
|
||||
# include "../sam/3x/vector_nvic.c"
|
||||
|
||||
#elif defined(VF6XX)
|
||||
# include "../vf6xx/vector_nvic.c"
|
||||
|
||||
#elif defined(LM3S) || defined(LM4F)
|
||||
/* Yes, we use the same interrupt table for both LM3S and LM4F */
|
||||
# include "../lm3s/vector_nvic.c"
|
||||
|
40
lib/vf6xx/Makefile
Normal file
40
lib/vf6xx/Makefile
Normal file
@ -0,0 +1,40 @@
|
||||
##
|
||||
## This file is part of the libopencm3 project.
|
||||
##
|
||||
## Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
|
||||
## Copyright (C) 2014 Stefan Agner <stefan@agner.ch>
|
||||
##
|
||||
## This library is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU Lesser General Public License as published by
|
||||
## the Free Software Foundation, either version 3 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This library is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU Lesser General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU Lesser General Public License
|
||||
## along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
LIBNAME = libopencm3_vf6xx
|
||||
SRCLIBDIR ?= ..
|
||||
|
||||
FP_FLAGS ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
PREFIX ?= arm-none-eabi
|
||||
|
||||
CC = $(PREFIX)-gcc
|
||||
AR = $(PREFIX)-ar
|
||||
CFLAGS = -Os -g \
|
||||
-Wall -Wextra -Wimplicit-function-declaration \
|
||||
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes \
|
||||
-Wundef -Wshadow \
|
||||
-I../../include -fno-common \
|
||||
-mcpu=cortex-m4 -mthumb $(FP_FLAGS) -Wstrict-prototypes \
|
||||
-ffunction-sections -fdata-sections -MD -DVF6XX
|
||||
ARFLAGS = rcs
|
||||
|
||||
VPATH += ../cm3
|
||||
|
||||
include ../Makefile.include
|
109
lib/vf6xx/libopencm3_vf6xx.ld
Normal file
109
lib/vf6xx/libopencm3_vf6xx.ld
Normal file
@ -0,0 +1,109 @@
|
||||
/*
|
||||
* This file is part of the libopencm3 project.
|
||||
*
|
||||
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
|
||||
* Copyright (C) 2014 Stefan Agner <stefan@agner.ch>
|
||||
*
|
||||
* This library is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* Generic linker script for VF6xx targets using libopencm3. */
|
||||
|
||||
/* Memory regions must be defined in the ld script which includes this one. */
|
||||
|
||||
/* Enforce emmition of the vector table. */
|
||||
EXTERN(vector_table)
|
||||
|
||||
/* Define the entry point of the output file. */
|
||||
ENTRY(reset_handler)
|
||||
|
||||
/* Define sections. */
|
||||
SECTIONS
|
||||
{
|
||||
.text : {
|
||||
*(.vectors) /* Vector table */
|
||||
. = ALIGN(0x400);
|
||||
*(.text.reset_handler) /* Force reset handler at start */
|
||||
*(.text*) /* Program code */
|
||||
. = ALIGN(4);
|
||||
*(.rodata*) /* Read-only data */
|
||||
. = ALIGN(4);
|
||||
} >pc_ram
|
||||
|
||||
/* C++ Static constructors/destructors, also used for __attribute__
|
||||
* ((constructor)) and the likes */
|
||||
.preinit_array : {
|
||||
. = ALIGN(4);
|
||||
__preinit_array_start = .;
|
||||
KEEP (*(.preinit_array))
|
||||
__preinit_array_end = .;
|
||||
} >pc_ram
|
||||
.init_array : {
|
||||
. = ALIGN(4);
|
||||
__init_array_start = .;
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array))
|
||||
__init_array_end = .;
|
||||
} >pc_ram
|
||||
.fini_array : {
|
||||
. = ALIGN(4);
|
||||
__fini_array_start = .;
|
||||
KEEP (*(.fini_array))
|
||||
KEEP (*(SORT(.fini_array.*)))
|
||||
__fini_array_end = .;
|
||||
} >pc_ram
|
||||
|
||||
/*
|
||||
* Another section used by C++ stuff, appears when using newlib with
|
||||
* 64bit (long long) printf support
|
||||
*/
|
||||
.ARM.extab : {
|
||||
*(.ARM.extab*)
|
||||
} >pc_ram
|
||||
.ARM.exidx : {
|
||||
__exidx_start = .;
|
||||
*(.ARM.exidx*)
|
||||
__exidx_end = .;
|
||||
} >pc_ram
|
||||
|
||||
. = ALIGN(4);
|
||||
_etext = .;
|
||||
|
||||
.data : {
|
||||
_data = .;
|
||||
*(.data*) /* Read-write initialized data */
|
||||
. = ALIGN(4);
|
||||
_edata = .;
|
||||
} >ps_ram AT >pc_ram
|
||||
_data_loadaddr = LOADADDR(.data);
|
||||
|
||||
.bss : {
|
||||
*(.bss*) /* Read-write zero initialized data */
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
_ebss = .;
|
||||
} >ps_ram
|
||||
|
||||
/*
|
||||
* The .eh_frame section appears to be used for C++ exception handling.
|
||||
* You may need to fix this if you're using C++.
|
||||
*/
|
||||
/DISCARD/ : { *(.eh_frame) }
|
||||
|
||||
. = ALIGN(4);
|
||||
end = .;
|
||||
}
|
||||
|
||||
PROVIDE(_stack = ORIGIN(ps_ram) + LENGTH(ps_ram));
|
||||
|
31
lib/vf6xx/vector_chipset.c
Normal file
31
lib/vf6xx/vector_chipset.c
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* This file is part of the libopencm3 project.
|
||||
*
|
||||
* Copyright (C) 2014 Stefan Agner <stefan@agner.ch>
|
||||
*
|
||||
* This library is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/cm3/scb.h>
|
||||
|
||||
static inline void pre_main(void)
|
||||
{
|
||||
/*
|
||||
* For Vybrid we need to set the stack pointer manually
|
||||
* since the boot ROM has its own stack
|
||||
*/
|
||||
asm ( \
|
||||
"ldr sp,=_stack;" \
|
||||
);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user