U-Boot port to Xtensa architecture
Subsystems (5)
Max Filippov
maintainercover U-Boot port to Xtensa architecture
Hi Tom,
this series adds U-Boot port to Xtensa, configurable processor architecture from Tensilica, Inc., now Cadence Design Systems Inc.
Preparation patches clean up OpenCores 10/100 MBit driver, enable it to be used with dedicated packet memory and with gigabit PHY. Two patches add proper xtensa bits: changes to shares files and contents of arch/xtensa. One more patch adds sample xtensa CPU configuration -- Diamond 232. One more patch adds xtfpga board family that consists of Avnet LX60, LX110 and LX200 and Xilinx ML605 and KC705 FPGA boards configured with xtensa bitstream.
The whole series is also available in the following git tree:
git://github.com/jcmvbkbc/u-boot-xtensa.git tags/xtensa-for-mainline-20140820
The port has been done mainly by Chris Zankel. I've been maintaining it internally for some time now and I'll maintain it upstream.
Chris Zankel (5):
net/ethoc: support private memory configurations
xtensa: add support for the xtensa processor architecture [1/2]
xtensa: add support for the xtensa processor architecture [2/2]
xtensa: add core information for the dc232b processor
xtensa: add support for the 'xtfpga' evaluation board
Max Filippov (3):
net/ethoc: fix warnings from ethoc_read/ethoc_write net/ethoc: don't advertise gigabit on the connected PHY
Makefile: allow overriding '-ansi' in LDPPFLAGS
CREDITS | 5 + MAKEALL | 6 + Makefile | 4 +- arch/Kconfig | 4 + arch/xtensa/Kconfig | 29 ++ arch/xtensa/config.mk | 13 + arch/xtensa/cpu/.gitignore | 1 + arch/xtensa/cpu/Makefile | 13 + arch/xtensa/cpu/config.mk | 9 + arch/xtensa/cpu/cpu.c | 84 ++++ arch/xtensa/cpu/exceptions.c | 67 +++ arch/xtensa/cpu/start.S | 672 ++++++++++++++++++++++++++ arch/xtensa/cpu/u-boot.lds.S | 107 ++++ arch/xtensa/include/asm/addrspace.h | 43 ++ arch/xtensa/include/asm/arch-dc232b/core.h | 422 ++++++++++++++++ arch/xtensa/include/asm/arch-dc232b/tie-asm.h | 120 +++++ arch/xtensa/include/asm/arch-dc232b/tie.h | 129 +++++ arch/xtensa/include/asm/asmmacro.h | 136 ++++++ arch/xtensa/include/asm/bitops.h | 14 + arch/xtensa/include/asm/bootparam.h | 54 +++ arch/xtensa/include/asm/byteorder.h | 81 ++++ arch/xtensa/include/asm/cache.h | 20 + arch/xtensa/include/asm/cacheasm.h | 187 +++++++ arch/xtensa/include/asm/config.h | 17 + arch/xtensa/include/asm/errno.h | 1 + arch/xtensa/include/asm/global_data.h | 24 + arch/xtensa/include/asm/io.h | 148 ++++++ arch/xtensa/include/asm/ldscript.h | 220 +++++++++ arch/xtensa/include/asm/linkage.h | 4 + arch/xtensa/include/asm/misc.h | 24 + arch/xtensa/include/asm/posix_types.h | 74 +++ arch/xtensa/include/asm/processor.h | 11 + arch/xtensa/include/asm/ptrace.h | 133 +++++ arch/xtensa/include/asm/regs.h | 95 ++++ arch/xtensa/include/asm/sections.h | 15 + arch/xtensa/include/asm/string.h | 10 + arch/xtensa/include/asm/types.h | 60 +++ arch/xtensa/include/asm/u-boot.h | 43 ++ arch/xtensa/include/asm/unaligned.h | 6 + arch/xtensa/include/asm/xtensa.h | 36 ++ arch/xtensa/lib/Makefile | 9 + arch/xtensa/lib/board.c | 173 +++++++ arch/xtensa/lib/bootm.c | 202 ++++++++ arch/xtensa/lib/misc.S | 178 +++++++ arch/xtensa/lib/time.c | 111 +++++ board/cadence/xtfpga/Kconfig | 51 ++ board/cadence/xtfpga/MAINTAINERS | 6 + board/cadence/xtfpga/Makefile | 8 + board/cadence/xtfpga/README | 121 +++++ board/cadence/xtfpga/lcd.c | 88 ++++ board/cadence/xtfpga/lcd.h | 12 + board/cadence/xtfpga/xtfpga.c | 173 +++++++ common/board_r.c | 2 +- common/cmd_bdinfo.c | 22 + common/image.c | 1 + configs/xtfpga_defconfig | 3 + doc/README.xtensa | 104 ++++ drivers/net/ethoc.c | 101 +++- examples/standalone/stubs.c | 45 ++ include/configs/xtfpga.h | 305 ++++++++++++ include/image.h | 1 + include/linux/stat.h | 4 +- 62 files changed, 4855 insertions(+), 6 deletions(-) create mode 100644 arch/xtensa/Kconfig create mode 100644 arch/xtensa/config.mk create mode 100644 arch/xtensa/cpu/.gitignore create mode 100644 arch/xtensa/cpu/Makefile create mode 100644 arch/xtensa/cpu/config.mk create mode 100644 arch/xtensa/cpu/cpu.c create mode 100644 arch/xtensa/cpu/exceptions.c create mode 100644 arch/xtensa/cpu/start.S create mode 100644 arch/xtensa/cpu/u-boot.lds.S create mode 100644 arch/xtensa/include/asm/addrspace.h create mode 100644 arch/xtensa/include/asm/arch-dc232b/core.h create mode 100644 arch/xtensa/include/asm/arch-dc232b/tie-asm.h create mode 100644 arch/xtensa/include/asm/arch-dc232b/tie.h create mode 100644 arch/xtensa/include/asm/asmmacro.h create mode 100644 arch/xtensa/include/asm/bitops.h create mode 100644 arch/xtensa/include/asm/bootparam.h create mode 100644 arch/xtensa/include/asm/byteorder.h create mode 100644 arch/xtensa/include/asm/cache.h create mode 100644 arch/xtensa/include/asm/cacheasm.h create mode 100644 arch/xtensa/include/asm/config.h create mode 100644 arch/xtensa/include/asm/errno.h create mode 100644 arch/xtensa/include/asm/global_data.h create mode 100644 arch/xtensa/include/asm/io.h create mode 100644 arch/xtensa/include/asm/ldscript.h create mode 100644 arch/xtensa/include/asm/linkage.h create mode 100644 arch/xtensa/include/asm/misc.h create mode 100644 arch/xtensa/include/asm/posix_types.h create mode 100644 arch/xtensa/include/asm/processor.h create mode 100644 arch/xtensa/include/asm/ptrace.h create mode 100644 arch/xtensa/include/asm/regs.h create mode 100644 arch/xtensa/include/asm/sections.h create mode 100644 arch/xtensa/include/asm/string.h create mode 100644 arch/xtensa/include/asm/types.h create mode 100644 arch/xtensa/include/asm/u-boot.h create mode 100644 arch/xtensa/include/asm/unaligned.h create mode 100644 arch/xtensa/include/asm/xtensa.h create mode 100644 arch/xtensa/lib/Makefile create mode 100644 arch/xtensa/lib/board.c create mode 100644 arch/xtensa/lib/bootm.c create mode 100644 arch/xtensa/lib/misc.S create mode 100644 arch/xtensa/lib/time.c create mode 100644 board/cadence/xtfpga/Kconfig create mode 100644 board/cadence/xtfpga/MAINTAINERS create mode 100644 board/cadence/xtfpga/Makefile create mode 100644 board/cadence/xtfpga/README create mode 100644 board/cadence/xtfpga/lcd.c create mode 100644 board/cadence/xtfpga/lcd.h create mode 100644 board/cadence/xtfpga/xtfpga.c create mode 100644 configs/xtfpga_defconfig create mode 100644 doc/README.xtensa create mode 100644 include/configs/xtfpga.h
Signature · 1 line
1.8.1.4
Max Filippov
maintainerPATCH 1/8 net/ethoc: support private memory configurations
From: Chris Zankel <[email protected]>
The 'ethoc' device could also be configured to have a private memory region instead of having access to the main memory. In that case, the packets must be copied into (transmit) or out of (receive) that memory.
This behavior is configured by defining CONFIG_SYS_ETHOC_BUFFER_ADDR. Make sure to have enough memory for the configured buffers (one for transmit, and 'PKTBUFSRX' for receive)
--- drivers/net/ethoc.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
drivers/net/ethoc.c +21 -0
@@ -248,6 +248,9 @@ static int ethoc_init_ring(struct eth_device *dev) {struct ethoc *priv = (struct ethoc *)dev->priv;struct ethoc_bd bd; +#ifdef CONFIG_SYS_ETHOC_BUFFER_ADDR +unsigned long addr =CONFIG_SYS_ETHOC_BUFFER_ADDR ; +#endif int i; priv->cur_tx =0 ;
@@ -258,6 +261,10 @@ static int ethoc_init_ring(struct eth_device *dev) bd.stat =TX_BD_IRQ |TX_BD_CRC ;for (i =0 ; i < priv->num_tx; i++) { +#ifdef CONFIG_SYS_ETHOC_BUFFER_ADDR + bd.addr = addr; + addr +=PKTSIZE_ALIGN ; +#endif if (i == priv->num_tx -1 ) bd.stat |=TX_BD_WRAP ;
@@ -267,7 +274,12 @@ static int ethoc_init_ring(struct eth_device *dev) bd.stat =RX_BD_EMPTY |RX_BD_IRQ ;for (i =0 ; i < priv->num_rx; i++) { +#ifdef CONFIG_SYS_ETHOC_BUFFER_ADDR + bd.addr = addr; + addr +=PKTSIZE_ALIGN ; +#else bd.addr = (u32 )NetRxPackets[i]; +#endif if (i == priv->num_rx -1 ) bd.stat |=RX_BD_WRAP ;
@@ -372,7 +384,12 @@ static int ethoc_rx(struct eth_device *dev, int limit)if (ethoc_update_rx_stats (&bd) ==0 ) {int size = bd.stat >>16 ; size -=4 ;/* strip the CRC */ +#ifdef CONFIG_SYS_ETHOC_BUFFER_ADDR +memcpy (NetRxPackets[0 ], (void *)bd.addr, size); +NetReceive (NetRxPackets[0 ], size); +#else NetReceive ((void *)bd.addr, size); +#endif }/* clear the buffer descriptor so it can be reused */
@@ -428,7 +445,11 @@ static int ethoc_send(struct eth_device *dev, void *packet, int length) bd.stat |=TX_BD_PAD ; else bd.stat &= ~TX_BD_PAD; +#ifdef CONFIG_SYS_ETHOC_BUFFER_ADDR +memcpy ((void *)bd.addr, (const void *)packet, length); +#else bd.addr = (u32 )packet; +#endif flush_dcache_range (bd.addr, bd.addr + length); bd.stat &= ~(TX_BD_STATS |TX_BD_LEN_MASK );
Signature · 1 line
1.8.1.4
Max Filippov
maintainerPATCH 2/8 net/ethoc: fix warnings from ethoc_read/ethoc_write
In reply to Max FilippovThere's no need to use loff_t to specify in-memory offset; size_t is smaller and is guaranteed to be sufficient to represent any memory object size.
--- drivers/net/ethoc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethoc.c +2 -2
@@ -189,12 +189,12 @@ struct ethoc_bd {u32 addr; }; -static inline u32 ethoc_read (struct eth_device *dev,loff_t offset) +static inline u32 ethoc_read (struct eth_device *dev,size_t offset) {return readl (dev->iobase + offset); } -static inline void ethoc_write (struct eth_device *dev,loff_t offset,u32 data) +static inline void ethoc_write (struct eth_device *dev,size_t offset,u32 data) {writel (data, dev->iobase + offset); }
Signature · 1 line
1.8.1.4
Max Filippov
maintainerPATCH 3/8 net/ethoc: don't advertise gigabit on the connected PHY
In reply to Max FilippovIntroduce MDIO communication routines. Scan MDIO bus at reset to find attached PHYs and see if they support gigabit speeds. If they do check their gigabit control register: if gigabit autonegotiation is enabled clear it and reset the PHY.
This allows using OpenCores 10/100 MAC with gigabit PHY connected to gigabit network.
--- drivers/net/ethoc.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+)
drivers/net/ethoc.c +76 -0
@@ -290,6 +290,80 @@ static int ethoc_init_ring(struct eth_device *dev)return 0 ; } +#ifdef CONFIG_SYS_ETHOC_SETUP_PHY + +static u16 ethoc_mii_read (struct eth_device *dev,u8 phy,u8 reg) +{ +ulong tmo =get_timer (0 ); + +ethoc_write (dev,MIIADDRESS ,MIIADDRESS_ADDR (phy, reg)); +ethoc_write (dev,MIICOMMAND ,MIICOMMAND_READ ); + +while (get_timer (tmo) <CONFIG_SYS_HZ ) { +u32 status =ethoc_read (dev,MIISTATUS ); +if (!(status &MIISTATUS_BUSY )) { +u32 data =ethoc_read (dev,MIIRX_DATA ); +/* reset MII command register */ +ethoc_write (dev,MIICOMMAND ,0 ); +return data; + } + } +return 0xffff ; +} + +static void ethoc_mii_write (struct eth_device *dev,u8 phy,u8 reg,u16 v) +{ +ulong tmo =get_timer (0 ); + +ethoc_write (dev,MIIADDRESS ,MIIADDRESS_ADDR (phy, reg)); +ethoc_write (dev,MIITX_DATA , v); +ethoc_write (dev,MIICOMMAND ,MIICOMMAND_WRITE ); + +while (get_timer (tmo) <CONFIG_SYS_HZ ) { +u32 stat =ethoc_read (dev,MIISTATUS ); +if (!(stat &MIISTATUS_BUSY )) { +/* reset MII command register */ +ethoc_write (dev,MIICOMMAND ,0 ); +return ; + } + } +} + +static void ethoc_setup_phy (struct eth_device *dev) +{ +u8 phy; + +ethoc_write (dev,MIIMODER ,0xfe ); + +for (phy =0 ; phy <32 ; ++phy) { +if (ethoc_mii_read (dev, phy,MII_PHYSID1 ) !=0xffff ) { +u16 v; + + v =ethoc_mii_read (dev, phy,MII_BMSR ); +if (!(v &BMSR_ESTATEN )) +continue ; + + v =ethoc_mii_read (dev, phy,MII_CTRL1000 ); +if (!(v & (ADVERTISE_1000FULL |ADVERTISE_1000HALF ))) +continue ; + +ethoc_mii_write (dev, phy,MII_CTRL1000 , + v & ~(ADVERTISE_1000FULL | +ADVERTISE_1000HALF )); + v =ethoc_mii_read (dev, phy,MII_BMCR ); +ethoc_mii_write (dev, phy,MII_BMCR , v |BMCR_RESET ); + } + } +} + +#else + +static inline void ethoc_setup_phy (struct eth_device *dev) +{ +} + +#endif +static int ethoc_reset (struct eth_device *dev) {u32 mode;
@@ -311,6 +385,8 @@ static int ethoc_reset(struct eth_device *dev)ethoc_write (dev,MODER , mode);ethoc_write (dev,IPGT ,0x15 ); +ethoc_setup_phy (dev); +ethoc_ack_irq (dev,INT_MASK_ALL );ethoc_enable_rx_and_tx (dev);return 0 ;
Signature · 1 line
1.8.1.4
Max Filippov
maintainerPATCH 4/8 Makefile: allow overriding '-ansi' in LDPPFLAGS
In reply to Max Filippovxtensa linker script cannot be preprocessed with -ansi option specified, so xtensa needs a way to override it.
--- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +2 -1
@@ -209,6 +209,7 @@ HOSTCXXFLAGS = -O2 ifeq ($(HOSTOS),cygwin) HOSTCFLAGS += -ansi endif +LDPPFLAGS += -ansi # Mac OS X / Darwin's C preprocessor is Apple specific. It # generates numerous errors and warnings. We want to bypass it
@@ -1121,7 +1122,7 @@ depend dep: # --------------------------------------------------------------------------- quiet_cmd_cpp_lds = LDS $@ -cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \ +cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) \ -D__ASSEMBLY__ -x assembler-with-cpp -P -o $@ $< u-boot.lds: $(LDSCRIPT) prepare FORCE
Signature · 1 line
1.8.1.4
Max Filippov
maintainerPATCH 5/8 xtensa: add support for the xtensa processor architecture [1/2]
In reply to Max FilippovFrom: Chris Zankel <[email protected]>
The Xtensa processor architecture is a configurable, extensible, and synthesizable 32-bit RISC processor core provided by Cadence.
This is the first part of the basic architecture port with changes to common files. The 'arch/xtensa' directory, and boards and additional drivers will be in separate commits.
--- CREDITS | 5 +++ MAKEALL | 6 +++ Makefile | 1 + common/board_r.c | 2 +- common/cmd_bdinfo.c | 22 ++++++++++ common/image.c | 1 + doc/README.xtensa | 104 ++++++++++++++++++++++++++++++++++++++++++++ examples/standalone/stubs.c | 45 +++++++++++++++++++ include/image.h | 1 + include/linux/stat.h | 4 +- 10 files changed, 188 insertions(+), 3 deletions(-) create mode 100644 doc/README.xtensa
CREDITS +5 -0
@@ -534,3 +534,8 @@ N: Philip Balister E: philip at opensdr.com D: Port to Lyrtech SFFSDR development board. W: www.opensdr.com + +N: Chris Zankel +E: chris at zankel.net +D: Port to Xtensa +W: www.linux-xtensa.org
MAKEALL +6 -0
@@ -505,6 +505,12 @@ LIST_nds32="$(targets_by_arch nds32)" LIST_arc="$(targets_by_arch arc)" +######################################################################### +## Xtensa Systems +######################################################################### + +LIST_xtensa="$(targets_by_arch xtensa)" + #----------------------------------------------------------------------- get_target_location() {
Makefile +1 -0
@@ -656,6 +656,7 @@ endif libs-$(CONFIG_ARM) += arch/arm/cpu/ libs-$(CONFIG_PPC) += arch/powerpc/cpu/ +libs-$(CONFIG_XTENSA) += arch/xtensa/cpu/ libs-y += $(if $(BOARDDIR),board/$(BOARDDIR)/)
common/board_r.c +1 -1
@@ -911,7 +911,7 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)int i;#endif -#ifndef CONFIG_X86 +#if !defined(CONFIG_X86 ) && !defined(CONFIG_XTENSA ) gd = new_gd;#endif
common/cmd_bdinfo.c +22 -0
@@ -536,6 +536,28 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])return 0 ; } +#elif defined(CONFIG_XTENSA ) + +int do_bdinfo (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) +{ +bd_t *bd = gd->bd; + +print_num ("boot_params" , (ulong )bd->bi_boot_params); +print_num ("memstart" , (ulong )bd->bi_memstart); +print_lnum ("memsize" , (u64 )bd->bi_memsize); +print_num ("flashstart" , (ulong )bd->bi_flashstart); +print_num ("flashsize" , (ulong )bd->bi_flashsize); +print_num ("flashoffset" , (ulong )bd->bi_flashoffset); + +#if defined(CONFIG_CMD_NET ) +print_eth (0 ); +printf ("ip_addr = %s\n" ,getenv ("ipaddr" )); +#endif +printf ("baudrate = %d bps\n" , gd->baudrate); + +return 0 ; +} +#else #error "a case for this architecture does not exist!"#endif
common/image.c +1 -0
@@ -85,6 +85,7 @@ static const table_entry_t uimage_arch[] = { { IH_ARCH_SANDBOX, "sandbox", "Sandbox", }, { IH_ARCH_ARM64, "arm64", "AArch64", }, { IH_ARCH_ARC, "arc", "ARC", }, + { IH_ARCH_XTENSA, "xtensa", "Xtensa", }, { -1, "", "", }, };
doc/README.xtensa new file +104 -0
104 lines not on this page · raw message
examples/standalone/stubs.c +45 -0
51 lines not on this page · raw message
include/image.h +1 -0
@@ -173,6 +173,7 @@ struct lmb;#define IH_ARCH_OPENRISC 21/* OpenRISC 1000 */ #define IH_ARCH_ARM64 22/* ARM64 */ #define IH_ARCH_ARC 23/* Synopsys DesignWare ARC */ +#define IH_ARCH_XTENSA 24/* Xtensa */ /* * Image Types
include/linux/stat.h +2 -2
@@ -126,7 +126,7 @@ struct stat {#endif /* __MIPS__ */ -#if defined(__AVR32__) || defined(__SH__) +#if defined(__AVR32__) || defined(__SH__) || defined(__XTENSA__) struct stat { unsigned long st_dev;
@@ -149,7 +149,7 @@ struct stat {unsigned long __unused5; }; -#endif /* __AVR32__ || __SH__ */ +#endif /* __AVR32__ || __SH__ || __XTENSA__ */ #ifdef __cplusplus }
Signature · 1 line
1.8.1.4
Max Filippov
maintainerPATCH 6/8 xtensa: add support for the xtensa processor architecture [2/2]
In reply to Max FilippovFrom: Chris Zankel <[email protected]>
The Xtensa processor architecture is a configurable, extensible, and synthesizable 32-bit RISC processor core provided by Tensilica, inc.
This is the second part of the basic architecture port, adding the 'arch/xtensa' directory and a readme file.
--- arch/Kconfig | 4 + arch/xtensa/Kconfig | 26 ++ arch/xtensa/config.mk | 13 + arch/xtensa/cpu/.gitignore | 1 + arch/xtensa/cpu/Makefile | 13 + arch/xtensa/cpu/config.mk | 9 + arch/xtensa/cpu/cpu.c | 84 +++++ arch/xtensa/cpu/exceptions.c | 67 ++++ arch/xtensa/cpu/start.S | 672 ++++++++++++++++++++++++++++++++++ arch/xtensa/cpu/u-boot.lds.S | 107 ++++++ arch/xtensa/include/asm/addrspace.h | 43 +++ arch/xtensa/include/asm/asmmacro.h | 136 +++++++ arch/xtensa/include/asm/bitops.h | 14 + arch/xtensa/include/asm/bootparam.h | 54 +++ arch/xtensa/include/asm/byteorder.h | 81 ++++ arch/xtensa/include/asm/cache.h | 20 + arch/xtensa/include/asm/cacheasm.h | 187 ++++++++++ arch/xtensa/include/asm/config.h | 17 + arch/xtensa/include/asm/errno.h | 1 + arch/xtensa/include/asm/global_data.h | 24 ++ arch/xtensa/include/asm/io.h | 148 ++++++++ arch/xtensa/include/asm/ldscript.h | 220 +++++++++++ arch/xtensa/include/asm/linkage.h | 4 + arch/xtensa/include/asm/misc.h | 24 ++ arch/xtensa/include/asm/posix_types.h | 74 ++++ arch/xtensa/include/asm/processor.h | 11 + arch/xtensa/include/asm/ptrace.h | 133 +++++++ arch/xtensa/include/asm/regs.h | 95 +++++ arch/xtensa/include/asm/sections.h | 15 + arch/xtensa/include/asm/string.h | 10 + arch/xtensa/include/asm/types.h | 60 +++ arch/xtensa/include/asm/u-boot.h | 43 +++ arch/xtensa/include/asm/unaligned.h | 6 + arch/xtensa/include/asm/xtensa.h | 36 ++ arch/xtensa/lib/Makefile | 9 + arch/xtensa/lib/board.c | 173 +++++++++ arch/xtensa/lib/bootm.c | 202 ++++++++++ arch/xtensa/lib/misc.S | 178 +++++++++ arch/xtensa/lib/time.c | 111 ++++++ 39 files changed, 3125 insertions(+) create mode 100644 arch/xtensa/Kconfig create mode 100644 arch/xtensa/config.mk create mode 100644 arch/xtensa/cpu/.gitignore create mode 100644 arch/xtensa/cpu/Makefile create mode 100644 arch/xtensa/cpu/config.mk create mode 100644 arch/xtensa/cpu/cpu.c create mode 100644 arch/xtensa/cpu/exceptions.c create mode 100644 arch/xtensa/cpu/start.S create mode 100644 arch/xtensa/cpu/u-boot.lds.S create mode 100644 arch/xtensa/include/asm/addrspace.h create mode 100644 arch/xtensa/include/asm/asmmacro.h create mode 100644 arch/xtensa/include/asm/bitops.h create mode 100644 arch/xtensa/include/asm/bootparam.h create mode 100644 arch/xtensa/include/asm/byteorder.h create mode 100644 arch/xtensa/include/asm/cache.h create mode 100644 arch/xtensa/include/asm/cacheasm.h create mode 100644 arch/xtensa/include/asm/config.h create mode 100644 arch/xtensa/include/asm/errno.h create mode 100644 arch/xtensa/include/asm/global_data.h create mode 100644 arch/xtensa/include/asm/io.h create mode 100644 arch/xtensa/include/asm/ldscript.h create mode 100644 arch/xtensa/include/asm/linkage.h create mode 100644 arch/xtensa/include/asm/misc.h create mode 100644 arch/xtensa/include/asm/posix_types.h create mode 100644 arch/xtensa/include/asm/processor.h create mode 100644 arch/xtensa/include/asm/ptrace.h create mode 100644 arch/xtensa/include/asm/regs.h create mode 100644 arch/xtensa/include/asm/sections.h create mode 100644 arch/xtensa/include/asm/string.h create mode 100644 arch/xtensa/include/asm/types.h create mode 100644 arch/xtensa/include/asm/u-boot.h create mode 100644 arch/xtensa/include/asm/unaligned.h create mode 100644 arch/xtensa/include/asm/xtensa.h create mode 100644 arch/xtensa/lib/Makefile create mode 100644 arch/xtensa/lib/board.c create mode 100644 arch/xtensa/lib/bootm.c create mode 100644 arch/xtensa/lib/misc.S create mode 100644 arch/xtensa/lib/time.c
arch/Kconfig +4 -0
@@ -47,6 +47,9 @@ config SPARC config X86 bool "x86 architecture" +config XTENSA + bool "Xtensa architecture" + endchoice source "arch/arc/Kconfig"
@@ -64,3 +67,4 @@ source "arch/sandbox/Kconfig" source "arch/sh/Kconfig" source "arch/sparc/Kconfig" source "arch/x86/Kconfig" +source "arch/xtensa/Kconfig"
arch/xtensa/Kconfig new file +26 -0
@@ -0,0 +1,26 @@ +menu "Xtensa architecture" + depends on XTENSA + +config SYS_ARCH + string + default "xtensa" + +config SYS_CPU + string "Xtensa Core Variant" + +choice + prompt "Target select" + + +endchoice + + +config HAVE_SYS_ASCDISP + bool + +config SYS_ASCDISP + bool "System LCD Display" + default y + depends on HAVE_SYS_ASCDISP + +endmenu
arch/xtensa/config.mk new file +13 -0
@@ -0,0 +1,13 @@ +# +# (C) Copyright 2007 - 2014 Tensilica, Inc. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +CROSS_COMPILE ?= xtensa-linux- +PLATFORM_CPPFLAGS += -D__XTENSA__ -mlongcalls + +CPUDIR = arch/$(ARCH)/cpu + +__HAVE_ARCH_GENERIC_BOARD := y +
arch/xtensa/cpu/.gitignore new file +1 -0
@@ -0,0 +1 @@ +u-boot.lds
arch/xtensa/cpu/Makefile new file +13 -0
@@ -0,0 +1,13 @@ +# +# (C) Copyright 2007 - 2013 Tensilica, Inc. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y = cpu.o exceptions.o +extra-y = start.o + +$(obj).depend.%: %.lds.S + $(CC) -M $(CPPFLAGS) $(EXTRA_CPPFLAGS_DEP) \ + -MQ $(obj)$(basename $<) $< >$@ +
arch/xtensa/cpu/config.mk new file +9 -0
@@ -0,0 +1,9 @@ +# +# (C) Copyright 2007 - 2013 Tensilica, Inc. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +# The linker script is pre-processed by CPP to adapt to the Xtensa core. +LDSCRIPT := $(srctree)/$(CPUDIR)/u-boot.lds.S +LDPPFLAGS := -I$(srctree)/include
arch/xtensa/cpu/cpu.c new file +84 -0
84 lines not on this page · raw message
arch/xtensa/cpu/exceptions.c new file +67 -0
67 lines not on this page · raw message
arch/xtensa/cpu/start.S new file +672 -0
672 lines not on this page · raw message
arch/xtensa/cpu/u-boot.lds.S new file +107 -0
107 lines not on this page · raw message
arch/xtensa/include/asm/addrspace.h new file +43 -0
43 lines not on this page · raw message
arch/xtensa/include/asm/asmmacro.h new file +136 -0
136 lines not on this page · raw message
arch/xtensa/include/asm/bitops.h new file +14 -0
@@ -0,0 +1,14 @@ +/* +* Atomic operations that C can't guarantee us.Useful for resource counting etc. +* +* Copyright (C) 2001 - 2012 Tensilica Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef _XTENSA_BITOPS_H +#define _XTENSA_BITOPS_H + +/* Use generic implementation */ + +#endif /* _XTENSA_BITOPS_H */
arch/xtensa/include/asm/bootparam.h new file +54 -0
54 lines not on this page · raw message
arch/xtensa/include/asm/byteorder.h new file +81 -0
81 lines not on this page · raw message
arch/xtensa/include/asm/cache.h new file +20 -0
@@ -0,0 +1,20 @@ +/* +* Copyright (C) 2009 Tensilica Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ +#ifndef _XTENSA_CACHE_H +#define _XTENSA_CACHE_H + +#include <asm/arch/core.h> + +#define ARCH_DMA_MINALIGN XCHAL_DCACHE_LINESIZE + +#ifndef __ASSEMBLY__ + +void __flush_invalidate_dcache_range (unsigned long addr,unsigned long size); +void __invalidate_icache_range (unsigned long addr,unsigned long size); + +#endif + +#endif /* _XTENSA_CACHE_H */
arch/xtensa/include/asm/cacheasm.h new file +187 -0
187 lines not on this page · raw message
arch/xtensa/include/asm/config.h new file +17 -0
@@ -0,0 +1,17 @@ +/* +* config file header +* +* Copyright (C) 2009 Tensilica Inc. +* Based on the Linux/Xtensa version of this header. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef _ASM_CONFIG_H_ +#define _ASM_CONFIG_H_ + +#include <asm/arch/core.h> + +#define CONFIG_LMB + +#endif
arch/xtensa/include/asm/errno.h new file +1 -0
@@ -0,0 +1 @@ +#include <asm-generic/errno.h>
arch/xtensa/include/asm/global_data.h new file +24 -0
@@ -0,0 +1,24 @@ +/* +* (C) Copyright 2007, Tensilica Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef _XTENSA_GBL_DATA_H +#define _XTENSA_GBL_DATA_H + +/* Architecture-specific global data */ + +struct arch_global_data { +unsigned long cpu_clk; +}; + +#include <asm-generic/global_data.h> + +#ifdef __XTENSA_CALL0_ABI__ +# define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd __asm__ ("a14") +#else +# define DECLARE_GLOBAL_DATA_PTR extern gd_t *gd +#endif + +#endif /* _XTENSA_GBL_DATA_H */
arch/xtensa/include/asm/io.h new file +148 -0
148 lines not on this page · raw message
arch/xtensa/include/asm/ldscript.h new file +220 -0
220 lines not on this page · raw message
arch/xtensa/include/asm/linkage.h new file +4 -0
@@ -0,0 +1,4 @@ +#ifndef __ASM_LINKAGE_H +#define __ASM_LINKAGE_H + +#endif
arch/xtensa/include/asm/misc.h new file +24 -0
@@ -0,0 +1,24 @@ +/* +* (C) Copyright 2008, Tensilica Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +* +******************************************************************** +* NOTE: This header file defines an interface to U-Boot. Including +* this (unmodified) header file in another file is considered normal +* use of U-Boot, and does *not* fall under the heading of "derived +* work". +******************************************************************** +*/ + +#ifndef _XTENSA_MISC_H +#define _XTENSA_MISC_H + +/* Defined in cpu/xtensa/u-boot.lds.S */ +void *__memory_avail_start; +void *__memory_avail_end; + +/* Used in cpu/xtensa/cpu.c */ +void board_reset (void ); + +#endif /* _XTENSA_MISC_H */
arch/xtensa/include/asm/posix_types.h new file +74 -0
74 lines not on this page · raw message
arch/xtensa/include/asm/processor.h new file +11 -0
@@ -0,0 +1,11 @@ +/* +* Copyright (C) 1997 Tensilica Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef _XTENSA_PROCESSOR_H +#define _XTENSA_PROCESSOR_H + + +#endif /* _XTENSA_PROCESSOR_H */
arch/xtensa/include/asm/ptrace.h new file +133 -0
133 lines not on this page · raw message
arch/xtensa/include/asm/regs.h new file +95 -0
95 lines not on this page · raw message
arch/xtensa/include/asm/sections.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Copyright (c) 2012 The Chromium OS Authors. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef __ASM_XTENSA_SECTIONS_H +#define __ASM_XTENSA_SECTIONS_H + +#include <asm-generic/sections.h> + +extern void *_text_start; +#define CONFIG_SYS_TEXT_BASE ((unsigned int)&_text_start) + +#endif
arch/xtensa/include/asm/string.h new file +10 -0
@@ -0,0 +1,10 @@ +#ifndef _XTENSA_STRING_H +#define _XTENSA_STRING_H + +/* +* Use the generic string functions in U-Boot's lib_generic. +* In the boot loader we care about compactness more than performance. +* Prototypes will be taken from <linux/string.h> +*/ + +#endif /* _XTENSA_STRING_H */
arch/xtensa/include/asm/types.h new file +60 -0
60 lines not on this page · raw message
arch/xtensa/include/asm/u-boot.h new file +43 -0
43 lines not on this page · raw message
arch/xtensa/include/asm/unaligned.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef _ASM_XTENSA_UNALIGNED_H +#define _ASM_XTENSA_UNALIGNED_H + +#include <asm-generic/unaligned.h> + +#endif /* _ASM_XTENSA_UNALIGNED_H */
arch/xtensa/include/asm/xtensa.h new file +36 -0
@@ -0,0 +1,36 @@ +/* +* Copyright (C) 2007 Tensilica, Inc. +* +* A place for global definitions specific to Xtensa-based ports. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef _XTENSA_H_ +#define _XTENSA_H_ + +#include <stdarg.h> +#include <config.h> +#include <asm/u-boot.h> + +/* Much of this is not specific to Xtensa and should move to a common header. */ + +/* Quote a macro value as a string constant. */ +#define QUOTE1 (s) #s +#define QUOTE (s) QUOTE1(s) + +/* Align a value up to nearest n-byte boundary, where n is a power of 2. */ +#define ALIGNUP (n, val) (((val) + (n)-1) & -(n)) + +#ifdef CONFIG_SYS_ASCDISP +/* +* Print a formatted string to the board's ASCII character display. +* String may have embedded newlines. Starts at top left and wraps long lines. +*/ +void display_printf (const char *fmt, ...); +void lcd_disp_at_pos (char *,unsigned char ); +#else +#define display_printf (fmt, args) +#endif + +#endif /* _XTENSA_H_ */
arch/xtensa/lib/Makefile new file +9 -0
@@ -0,0 +1,9 @@ +# +# (C) Copyright 2007 - 2013 Tensilica Inc. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-$(CONFIG_CMD_BOOTM) += bootm.o + +obj-y += misc.o time.o board.o
arch/xtensa/lib/board.c new file +173 -0
173 lines not on this page · raw message
arch/xtensa/lib/bootm.c new file +202 -0
202 lines not on this page · raw message
arch/xtensa/lib/misc.S new file +178 -0
155 lines not on this page · raw message
arch/xtensa/lib/time.c new file +111 -0
111 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.8.1.4
Part of the diff is not shown here. View the raw message.
PATCH 6/8 xtensa: add support for the xtensa processor architecture [2/2]
Hi Max,
Quoted 81 lines · Max Filippov
From: Chris Zankel <[email protected]>
The Xtensa processor architecture is a configurable, extensible, and synthesizable 32-bit RISC processor core provided by Tensilica, inc.
This is the second part of the basic architecture port, adding the '
arch/xtensa' directory and a readme file.Signed-off-by Chris Zankel <[email protected]>Signed-off-by Max Filippov <[email protected]>--- arch/Kconfig | 4 + arch/xtensa/Kconfig | 26 ++ arch/xtensa/config.mk | 13 + arch/xtensa/cpu/.gitignore | 1 + arch/xtensa/cpu/Makefile | 13 + arch/xtensa/cpu/config.mk | 9 + arch/xtensa/cpu/cpu.c | 84 +++++ arch/xtensa/cpu/exceptions.c | 67 ++++ arch/xtensa/cpu/start.S | 672 ++++++++++++++++++++++++++++++++++ arch/xtensa/cpu/u-boot.lds.S | 107 ++++++ arch/xtensa/include/asm/addrspace.h | 43 +++ arch/xtensa/include/asm/asmmacro.h | 136 +++++++ arch/xtensa/include/asm/bitops.h | 14 + arch/xtensa/include/asm/bootparam.h | 54 +++ arch/xtensa/include/asm/byteorder.h | 81 ++++ arch/xtensa/include/asm/cache.h | 20 + arch/xtensa/include/asm/cacheasm.h | 187 ++++++++++ arch/xtensa/include/asm/config.h | 17 + arch/xtensa/include/asm/errno.h | 1 + arch/xtensa/include/asm/global_data.h | 24 ++ arch/xtensa/include/asm/io.h | 148 ++++++++ arch/xtensa/include/asm/ldscript.h | 220 +++++++++++ arch/xtensa/include/asm/linkage.h | 4 + arch/xtensa/include/asm/misc.h | 24 ++ arch/xtensa/include/asm/posix_types.h | 74 ++++ arch/xtensa/include/asm/processor.h | 11 + arch/xtensa/include/asm/ptrace.h | 133 +++++++ arch/xtensa/include/asm/regs.h | 95 +++++ arch/xtensa/include/asm/sections.h | 15 + arch/xtensa/include/asm/string.h | 10 + arch/xtensa/include/asm/types.h | 60 +++ arch/xtensa/include/asm/u-boot.h | 43 +++ arch/xtensa/include/asm/unaligned.h | 6 + arch/xtensa/include/asm/xtensa.h | 36 ++ arch/xtensa/lib/Makefile | 9 + arch/xtensa/lib/board.c | 173 +++++++++ arch/xtensa/lib/bootm.c | 202 ++++++++++ arch/xtensa/lib/misc.S | 178 +++++++++ arch/xtensa/lib/time.c | 111 ++++++ 39 files changed, 3125 insertions(+) create mode 100644 arch/xtensa/Kconfig create mode 100644 arch/xtensa/config.mk create mode 100644 arch/xtensa/cpu/.gitignore create mode 100644 arch/xtensa/cpu/Makefile create mode 100644 arch/xtensa/cpu/config.mk create mode 100644 arch/xtensa/cpu/cpu.c create mode 100644 arch/xtensa/cpu/exceptions.c create mode 100644 arch/xtensa/cpu/start.S create mode 100644 arch/xtensa/cpu/u-boot.lds.S create mode 100644 arch/xtensa/include/asm/addrspace.h create mode 100644 arch/xtensa/include/asm/asmmacro.h create mode 100644 arch/xtensa/include/asm/bitops.h create mode 100644 arch/xtensa/include/asm/bootparam.h create mode 100644 arch/xtensa/include/asm/byteorder.h create mode 100644 arch/xtensa/include/asm/cache.h create mode 100644 arch/xtensa/include/asm/cacheasm.h create mode 100644 arch/xtensa/include/asm/config.h create mode 100644 arch/xtensa/include/asm/errno.h create mode 100644 arch/xtensa/include/asm/global_data.h create mode 100644 arch/xtensa/include/asm/io.h create mode 100644 arch/xtensa/include/asm/ldscript.h create mode 100644 arch/xtensa/include/asm/linkage.h create mode 100644 arch/xtensa/include/asm/misc.h create mode 100644 arch/xtensa/include/asm/posix_types.h create mode 100644 arch/xtensa/include/asm/processor.h create mode 100644 arch/xtensa/include/asm/ptrace.h create mode 100644 arch/xtensa/include/asm/regs.h create mode 100644 arch/xtensa/include/asm/sections.h create mode 100644 arch/xtensa/include/asm/string.h create mode 100644 arch/xtensa/include/asm/types.h
Quoted 8 lines
create mode 100644 arch/xtensa/include/asm/u-boot.h create mode 100644 arch/xtensa/include/asm/unaligned.h create mode 100644 arch/xtensa/include/asm/xtensa.h create mode 100644 arch/xtensa/lib/Makefile create mode 100644 arch/xtensa/lib/board.c create mode 100644 arch/xtensa/lib/bootm.c create mode 100644 arch/xtensa/lib/misc.S create mode 100644 arch/xtensa/lib/time.c
This all looks quite tidy, from a brief look.
But please make sure you use generic board - CONFIG_SYS_GENERIC_BOARD. You should not need a board.c file.
Also for your do_bootm_linux() implementation, see if you can check the flags, and thus support the bootm sub-commands.
If you have a microsecond timer, you could implement timer_get_us().
Regards,
Simon
Max Filippov
maintainerPATCH 6/8 xtensa: add support for the xtensa processor architecture [2/2]
Hi Simon,
Quoted 93 lines · Simon Glass
Hi Max,
Quoted 81 lines · Max Filippov
From: Chris Zankel <[email protected]>
The Xtensa processor architecture is a configurable, extensible, and synthesizable 32-bit RISC processor core provided by Tensilica, inc.
This is the second part of the basic architecture port, adding the '
arch/xtensa' directory and a readme file.Signed-off-by Chris Zankel <[email protected]>Signed-off-by Max Filippov <[email protected]>--- arch/Kconfig | 4 + arch/xtensa/Kconfig | 26 ++ arch/xtensa/config.mk | 13 + arch/xtensa/cpu/.gitignore | 1 + arch/xtensa/cpu/Makefile | 13 + arch/xtensa/cpu/config.mk | 9 + arch/xtensa/cpu/cpu.c | 84 +++++ arch/xtensa/cpu/exceptions.c | 67 ++++ arch/xtensa/cpu/start.S | 672 ++++++++++++++++++++++++++++++++++ arch/xtensa/cpu/u-boot.lds.S | 107 ++++++ arch/xtensa/include/asm/addrspace.h | 43 +++ arch/xtensa/include/asm/asmmacro.h | 136 +++++++ arch/xtensa/include/asm/bitops.h | 14 + arch/xtensa/include/asm/bootparam.h | 54 +++ arch/xtensa/include/asm/byteorder.h | 81 ++++ arch/xtensa/include/asm/cache.h | 20 + arch/xtensa/include/asm/cacheasm.h | 187 ++++++++++ arch/xtensa/include/asm/config.h | 17 + arch/xtensa/include/asm/errno.h | 1 + arch/xtensa/include/asm/global_data.h | 24 ++ arch/xtensa/include/asm/io.h | 148 ++++++++ arch/xtensa/include/asm/ldscript.h | 220 +++++++++++ arch/xtensa/include/asm/linkage.h | 4 + arch/xtensa/include/asm/misc.h | 24 ++ arch/xtensa/include/asm/posix_types.h | 74 ++++ arch/xtensa/include/asm/processor.h | 11 + arch/xtensa/include/asm/ptrace.h | 133 +++++++ arch/xtensa/include/asm/regs.h | 95 +++++ arch/xtensa/include/asm/sections.h | 15 + arch/xtensa/include/asm/string.h | 10 + arch/xtensa/include/asm/types.h | 60 +++ arch/xtensa/include/asm/u-boot.h | 43 +++ arch/xtensa/include/asm/unaligned.h | 6 + arch/xtensa/include/asm/xtensa.h | 36 ++ arch/xtensa/lib/Makefile | 9 + arch/xtensa/lib/board.c | 173 +++++++++ arch/xtensa/lib/bootm.c | 202 ++++++++++ arch/xtensa/lib/misc.S | 178 +++++++++ arch/xtensa/lib/time.c | 111 ++++++ 39 files changed, 3125 insertions(+) create mode 100644 arch/xtensa/Kconfig create mode 100644 arch/xtensa/config.mk create mode 100644 arch/xtensa/cpu/.gitignore create mode 100644 arch/xtensa/cpu/Makefile create mode 100644 arch/xtensa/cpu/config.mk create mode 100644 arch/xtensa/cpu/cpu.c create mode 100644 arch/xtensa/cpu/exceptions.c create mode 100644 arch/xtensa/cpu/start.S create mode 100644 arch/xtensa/cpu/u-boot.lds.S create mode 100644 arch/xtensa/include/asm/addrspace.h create mode 100644 arch/xtensa/include/asm/asmmacro.h create mode 100644 arch/xtensa/include/asm/bitops.h create mode 100644 arch/xtensa/include/asm/bootparam.h create mode 100644 arch/xtensa/include/asm/byteorder.h create mode 100644 arch/xtensa/include/asm/cache.h create mode 100644 arch/xtensa/include/asm/cacheasm.h create mode 100644 arch/xtensa/include/asm/config.h create mode 100644 arch/xtensa/include/asm/errno.h create mode 100644 arch/xtensa/include/asm/global_data.h create mode 100644 arch/xtensa/include/asm/io.h create mode 100644 arch/xtensa/include/asm/ldscript.h create mode 100644 arch/xtensa/include/asm/linkage.h create mode 100644 arch/xtensa/include/asm/misc.h create mode 100644 arch/xtensa/include/asm/posix_types.h create mode 100644 arch/xtensa/include/asm/processor.h create mode 100644 arch/xtensa/include/asm/ptrace.h create mode 100644 arch/xtensa/include/asm/regs.h create mode 100644 arch/xtensa/include/asm/sections.h create mode 100644 arch/xtensa/include/asm/string.h create mode 100644 arch/xtensa/include/asm/types.hQuoted 8 lines
create mode 100644 arch/xtensa/include/asm/u-boot.h create mode 100644 arch/xtensa/include/asm/unaligned.h create mode 100644 arch/xtensa/include/asm/xtensa.h create mode 100644 arch/xtensa/lib/Makefile create mode 100644 arch/xtensa/lib/board.c create mode 100644 arch/xtensa/lib/bootm.c create mode 100644 arch/xtensa/lib/misc.S create mode 100644 arch/xtensa/lib/time.c
Quoted 1 line
This all looks quite tidy, from a brief look.
Thanks for your feedback.
Quoted 2 lines
But please make sure you use generic board -
CONFIG_SYS_GENERIC_BOARD. You should not need aboard.cfile.
Will fix.
Quoted 2 lines
Also for your
do_bootm_linux()implementation, see if you can check the flags, and thus support the bootm sub-commands.
Ok.
Quoted 1 line
If you have a microsecond timer, you could implement
timer_get_us().
Ok, will add.
Signature · 2 lines
Thanks. -- Max
Max Filippov
maintainerPATCH 7/8 xtensa: add core information for the dc232b processor
In reply to Max FilippovFrom: Chris Zankel <[email protected]>
--- arch/xtensa/include/asm/arch-dc232b/core.h | 422 ++++++++++++++++++++++++++ arch/xtensa/include/asm/arch-dc232b/tie-asm.h | 120 ++++++++ arch/xtensa/include/asm/arch-dc232b/tie.h | 129 ++++++++ 3 files changed, 671 insertions(+) create mode 100644 arch/xtensa/include/asm/arch-dc232b/core.h create mode 100644 arch/xtensa/include/asm/arch-dc232b/tie-asm.h create mode 100644 arch/xtensa/include/asm/arch-dc232b/tie.h
arch/xtensa/include/asm/arch-dc232b/core.h new file +422 -0
@@ -0,0 +1,422 @@ +/* +* Xtensa processor core configuration information. +* +* Copyright (c) 1999-2007 Tensilica Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef _XTENSA_CORE_CONFIGURATION_H +#define _XTENSA_CORE_CONFIGURATION_H + + +/**************************************************************************** +Parameters Useful for Any Code, USER or PRIVILEGED +****************************************************************************/ + +/* +* Note: Macros of the form XCHAL_HAVE_*** have a value of 1 if the option is +* configured, and a value of 0 otherwise. These macros are always defined. +*/ + + +/*---------------------------------------------------------------------- +ISA +----------------------------------------------------------------------*/ + +#define XCHAL_HAVE_BE 0/* big-endian byte ordering */ +#define XCHAL_HAVE_WINDOWED 1/* windowed registers option */ +#define XCHAL_NUM_AREGS 32/* num of physical addr regs */ +#define XCHAL_NUM_AREGS_LOG2 5/* log2(XCHAL_NUM_AREGS) */ +#define XCHAL_MAX_INSTRUCTION_SIZE 3/* max instr bytes (3..8) */ +#define XCHAL_HAVE_DEBUG 1/* debug option */ +#define XCHAL_HAVE_DENSITY 1/* 16-bit instructions */ +#define XCHAL_HAVE_LOOPS 1/* zero-overhead loops */ +#define XCHAL_HAVE_NSA 1/* NSA/NSAU instructions */ +#define XCHAL_HAVE_MINMAX 1/* MIN/MAX instructions */ +#define XCHAL_HAVE_SEXT 1/* SEXT instruction */ +#define XCHAL_HAVE_CLAMPS 1/* CLAMPS instruction */ +#define XCHAL_HAVE_MUL16 1/* MUL16S/MUL16U instructions */ +#define XCHAL_HAVE_MUL32 1/* MULL instruction */ +#define XCHAL_HAVE_MUL32_HIGH 0/* MULUH/MULSH instructions */ +#define XCHAL_HAVE_DIV32 1/* QUOS/QUOU/REMS/REMU instructions */ +#define XCHAL_HAVE_L32R 1/* L32R instruction */ +#define XCHAL_HAVE_ABSOLUTE_LITERALS 1/* non-PC-rel (extended) L32R */ +#define XCHAL_HAVE_CONST16 0/* CONST16 instruction */ +#define XCHAL_HAVE_ADDX 1/* ADDX#/SUBX# instructions */ +#define XCHAL_HAVE_WIDE_BRANCHES 0/* B*.W18 or B*.W15 instr's */ +#define XCHAL_HAVE_PREDICTED_BRANCHES 0/* B[EQ/EQZ/NE/NEZ]T instr's */ +#define XCHAL_HAVE_CALL4AND12 1/* (obsolete option) */ +#define XCHAL_HAVE_ABS 1/* ABS instruction */ +/*#define XCHAL_HAVE_POPC 0*/ /* POPC instruction */ +/*#define XCHAL_HAVE_CRC 0*/ /* CRC instruction */ +#define XCHAL_HAVE_RELEASE_SYNC 1/* L32AI/S32RI instructions */ +#define XCHAL_HAVE_S32C1I 1/* S32C1I instruction */ +#define XCHAL_HAVE_SPECULATION 0/* speculation */ +#define XCHAL_HAVE_FULL_RESET 1/* all regs/state reset */ +#define XCHAL_NUM_CONTEXTS 1/* */ +#define XCHAL_NUM_MISC_REGS 2/* num of scratch regs (0..4) */ +#define XCHAL_HAVE_TAP_MASTER 0/* JTAG TAP control instr's */ +#define XCHAL_HAVE_PRID 1/* processor ID register */ +#define XCHAL_HAVE_THREADPTR 1/* THREADPTR register */ +#define XCHAL_HAVE_BOOLEANS 0/* boolean registers */ +#define XCHAL_HAVE_CP 1/* CPENABLE reg (coprocessor) */ +#define XCHAL_CP_MAXCFG 8/* max allowed cp id plus one */ +#define XCHAL_HAVE_MAC16 1/* MAC16 package */ +#define XCHAL_HAVE_VECTORFPU2005 0/* vector floating-point pkg */ +#define XCHAL_HAVE_FP 0/* floating point pkg */ +#define XCHAL_HAVE_VECTRA1 0/* Vectra I pkg */ +#define XCHAL_HAVE_VECTRALX 0/* Vectra LX pkg */ +#define XCHAL_HAVE_HIFI2 0/* HiFi2 Audio Engine pkg */ + + +/*---------------------------------------------------------------------- +MISC +----------------------------------------------------------------------*/ + +#define XCHAL_NUM_WRITEBUFFER_ENTRIES 8/* size of write buffer */ +#define XCHAL_INST_FETCH_WIDTH 4/* instr-fetch width in bytes */ +#define XCHAL_DATA_WIDTH 4/* data width in bytes */ +/* In T1050, applies to selected core load and store instructions (see ISA): */ +#define XCHAL_UNALIGNED_LOAD_EXCEPTION 1/* unaligned loads cause exc. */ +#define XCHAL_UNALIGNED_STORE_EXCEPTION 1/* unaligned stores cause exc.*/ + +#define XCHAL_SW_VERSION 701001/* sw version of this header */ + +#define XCHAL_CORE_ID "dc232b"/* alphanum core name +(CoreID) set in the Xtensa +Processor Generator */ + +#define XCHAL_CORE_DESCRIPTION "Diamond 232L Standard Core Rev.B (LE)" +#define XCHAL_BUILD_UNIQUE_ID 0x0000BEEF/* 22-bit sw build ID */ + +/* +* These definitions describe the hardware targeted by this software. +*/ +#define XCHAL_HW_CONFIGID0 0xC56307FE/* ConfigID hi 32 bits*/ +#define XCHAL_HW_CONFIGID1 0x0D40BEEF/* ConfigID lo 32 bits*/ +#define XCHAL_HW_VERSION_NAME "LX2.1.1"/* full version name */ +#define XCHAL_HW_VERSION_MAJOR 2210/* major ver# of targeted hw */ +#define XCHAL_HW_VERSION_MINOR 1/* minor ver# of targeted hw */ +#define XCHAL_HW_VERSION 221001/* major*100+minor */ +#define XCHAL_HW_REL_LX2 1 +#define XCHAL_HW_REL_LX2_1 1 +#define XCHAL_HW_REL_LX2_1_1 1 +#define XCHAL_HW_CONFIGID_RELIABLE 1 +/* If software targets a *range* of hardware versions, these are the bounds: */ +#define XCHAL_HW_MIN_VERSION_MAJOR 2210/* major v of earliest tgt hw */ +#define XCHAL_HW_MIN_VERSION_MINOR 1/* minor v of earliest tgt hw */ +#define XCHAL_HW_MIN_VERSION 221001/* earliest targeted hw */ +#define XCHAL_HW_MAX_VERSION_MAJOR 2210/* major v of latest tgt hw */ +#define XCHAL_HW_MAX_VERSION_MINOR 1/* minor v of latest tgt hw */ +#define XCHAL_HW_MAX_VERSION 221001/* latest targeted hw */ + + +/*---------------------------------------------------------------------- +CACHE +----------------------------------------------------------------------*/ + +#define XCHAL_ICACHE_LINESIZE 32/* I-cache line size in bytes */ +#define XCHAL_DCACHE_LINESIZE 32/* D-cache line size in bytes */ +#define XCHAL_ICACHE_LINEWIDTH 5/* log2(I line size in bytes) */ +#define XCHAL_DCACHE_LINEWIDTH 5/* log2(D line size in bytes) */ + +#define XCHAL_ICACHE_SIZE 16384/* I-cache size in bytes or 0 */ +#define XCHAL_DCACHE_SIZE 16384/* D-cache size in bytes or 0 */ + +#define XCHAL_DCACHE_IS_WRITEBACK 1/* writeback feature */ + + + + +/**************************************************************************** +Parameters Useful for PRIVILEGED (Supervisory or Non-Virtualized) Code +****************************************************************************/ + + +#ifndef XTENSA_HAL_NON_PRIVILEGED_ONLY + +/*---------------------------------------------------------------------- +CACHE +----------------------------------------------------------------------*/ + +#define XCHAL_HAVE_PIF 1/* any outbound PIF present */ + +/* If present, cache size in bytes == (ways * 2^(linewidth + setwidth)). */ + +/* Number of cache sets in log2(lines per way): */ +#define XCHAL_ICACHE_SETWIDTH 7 +#define XCHAL_DCACHE_SETWIDTH 7 + +/* Cache set associativity (number of ways): */ +#define XCHAL_ICACHE_WAYS 4 +#define XCHAL_DCACHE_WAYS 4 + +/* Cache features: */ +#define XCHAL_ICACHE_LINE_LOCKABLE 1 +#define XCHAL_DCACHE_LINE_LOCKABLE 1 +#define XCHAL_ICACHE_ECC_PARITY 0 +#define XCHAL_DCACHE_ECC_PARITY 0 + +/* Number of encoded cache attr bits (see <xtensa/hal.h> for decoded bits): */ +#define XCHAL_CA_BITS 4 + + +/*---------------------------------------------------------------------- +INTERNAL I/D RAM/ROMs and XLMI +----------------------------------------------------------------------*/ + +#define XCHAL_NUM_INSTROM 0/* number of core instr. ROMs */ +#define XCHAL_NUM_INSTRAM 0/* number of core instr. RAMs */ +#define XCHAL_NUM_DATAROM 0/* number of core data ROMs */ +#define XCHAL_NUM_DATARAM 0/* number of core data RAMs */ +#define XCHAL_NUM_URAM 0/* number of core unified RAMs*/ +#define XCHAL_NUM_XLMI 0/* number of core XLMI ports */ + + +/*---------------------------------------------------------------------- +INTERRUPTS and TIMERS +----------------------------------------------------------------------*/ + +#define XCHAL_HAVE_INTERRUPTS 1/* interrupt option */ +#define XCHAL_HAVE_HIGHPRI_INTERRUPTS 1/* med/high-pri. interrupts */ +#define XCHAL_HAVE_NMI 1/* non-maskable interrupt */ +#define XCHAL_HAVE_CCOUNT 1/* CCOUNT reg. (timer option) */ +#define XCHAL_NUM_TIMERS 3/* number of CCOMPAREn regs */ +#define XCHAL_NUM_INTERRUPTS 22/* number of interrupts */ +#define XCHAL_NUM_INTERRUPTS_LOG2 5/* ceil(log2(NUM_INTERRUPTS)) */ +#define XCHAL_NUM_EXTINTERRUPTS 17/* num of external interrupts */ +#define XCHAL_NUM_INTLEVELS 6/* number of interrupt levels +(not including level zero) */ +#define XCHAL_EXCM_LEVEL 3/* level masked by PS.EXCM */ +/* (always 1 in XEA1; levels 2 .. EXCM_LEVEL are "medium priority") */ + +/* Masks of interrupts at each interrupt level: */ +#define XCHAL_INTLEVEL1_MASK 0x001F80FF +#define XCHAL_INTLEVEL2_MASK 0x00000100 +#define XCHAL_INTLEVEL3_MASK 0x00200E00 +#define XCHAL_INTLEVEL4_MASK 0x00001000 +#define XCHAL_INTLEVEL5_MASK 0x00002000 +#define XCHAL_INTLEVEL6_MASK 0x00000000 +#define XCHAL_INTLEVEL7_MASK 0x00004000 + +/* Masks of interrupts at each range 1..n of interrupt levels: */ +#define XCHAL_INTLEVEL1_ANDBELOW_MASK 0x001F80FF +#define XCHAL_INTLEVEL2_ANDBELOW_MASK 0x001F81FF +#define XCHAL_INTLEVEL3_ANDBELOW_MASK 0x003F8FFF +#define XCHAL_INTLEVEL4_ANDBELOW_MASK 0x003F9FFF +#define XCHAL_INTLEVEL5_ANDBELOW_MASK 0x003FBFFF +#define XCHAL_INTLEVEL6_ANDBELOW_MASK 0x003FBFFF +#define XCHAL_INTLEVEL7_ANDBELOW_MASK 0x003FFFFF + +/* Level of each interrupt: */ +#define XCHAL_INT0_LEVEL 1 +#define XCHAL_INT1_LEVEL 1 +#define XCHAL_INT2_LEVEL 1 +#define XCHAL_INT3_LEVEL 1 +#define XCHAL_INT4_LEVEL 1 +#define XCHAL_INT5_LEVEL 1 +#define XCHAL_INT6_LEVEL 1 +#define XCHAL_INT7_LEVEL 1 +#define XCHAL_INT8_LEVEL 2 +#define XCHAL_INT9_LEVEL 3 +#define XCHAL_INT10_LEVEL 3 +#define XCHAL_INT11_LEVEL 3 +#define XCHAL_INT12_LEVEL 4 +#define XCHAL_INT13_LEVEL 5 +#define XCHAL_INT14_LEVEL 7 +#define XCHAL_INT15_LEVEL 1 +#define XCHAL_INT16_LEVEL 1 +#define XCHAL_INT17_LEVEL 1 +#define XCHAL_INT18_LEVEL 1 +#define XCHAL_INT19_LEVEL 1 +#define XCHAL_INT20_LEVEL 1 +#define XCHAL_INT21_LEVEL 3 +#define XCHAL_DEBUGLEVEL 6/* debug interrupt level */ +#define XCHAL_HAVE_DEBUG_EXTERN_INT 1/* OCD external db interrupt */ +#define XCHAL_NMILEVEL 7/* NMI "level" (for use with +EXCSAVE/EPS/EPC_n, RFI n) */ + +/* Type of each interrupt: */ +#define XCHAL_INT0_TYPE XTHAL_INTTYPE_EXTERN_LEVEL +#define XCHAL_INT1_TYPE XTHAL_INTTYPE_EXTERN_LEVEL +#define XCHAL_INT2_TYPE XTHAL_INTTYPE_EXTERN_LEVEL +#define XCHAL_INT3_TYPE XTHAL_INTTYPE_EXTERN_LEVEL +#define XCHAL_INT4_TYPE XTHAL_INTTYPE_EXTERN_LEVEL +#define XCHAL_INT5_TYPE XTHAL_INTTYPE_EXTERN_LEVEL +#define XCHAL_INT6_TYPE XTHAL_INTTYPE_TIMER +#define XCHAL_INT7_TYPE XTHAL_INTTYPE_SOFTWARE +#define XCHAL_INT8_TYPE XTHAL_INTTYPE_EXTERN_LEVEL +#define XCHAL_INT9_TYPE XTHAL_INTTYPE_EXTERN_LEVEL +#define XCHAL_INT10_TYPE XTHAL_INTTYPE_TIMER +#define XCHAL_INT11_TYPE XTHAL_INTTYPE_SOFTWARE +#define XCHAL_INT12_TYPE XTHAL_INTTYPE_EXTERN_LEVEL +#define XCHAL_INT13_TYPE XTHAL_INTTYPE_TIMER +#define XCHAL_INT14_TYPE XTHAL_INTTYPE_NMI +#define XCHAL_INT15_TYPE XTHAL_INTTYPE_EXTERN_EDGE +#define XCHAL_INT16_TYPE XTHAL_INTTYPE_EXTERN_EDGE +#define XCHAL_INT17_TYPE XTHAL_INTTYPE_EXTERN_EDGE +#define XCHAL_INT18_TYPE XTHAL_INTTYPE_EXTERN_EDGE +#define XCHAL_INT19_TYPE XTHAL_INTTYPE_EXTERN_EDGE +#define XCHAL_INT20_TYPE XTHAL_INTTYPE_EXTERN_EDGE +#define XCHAL_INT21_TYPE XTHAL_INTTYPE_EXTERN_EDGE + +/* Masks of interrupts for each type of interrupt: */ +#define XCHAL_INTTYPE_MASK_UNCONFIGURED 0xFFC00000 +#define XCHAL_INTTYPE_MASK_SOFTWARE 0x00000880 +#define XCHAL_INTTYPE_MASK_EXTERN_EDGE 0x003F8000 +#define XCHAL_INTTYPE_MASK_EXTERN_LEVEL 0x0000133F +#define XCHAL_INTTYPE_MASK_TIMER 0x00002440 +#define XCHAL_INTTYPE_MASK_NMI 0x00004000 +#define XCHAL_INTTYPE_MASK_WRITE_ERROR 0x00000000 + +/* Interrupt numbers assigned to specific interrupt sources: */ +#define XCHAL_TIMER0_INTERRUPT 6/* CCOMPARE0 */ +#define XCHAL_TIMER1_INTERRUPT 10/* CCOMPARE1 */ +#define XCHAL_TIMER2_INTERRUPT 13/* CCOMPARE2 */ +#define XCHAL_TIMER3_INTERRUPT XTHAL_TIMER_UNCONFIGURED +#define XCHAL_NMI_INTERRUPT 14/* non-maskable interrupt */ + +/* Interrupt numbers for levels at which only one interrupt is configured: */ +#define XCHAL_INTLEVEL2_NUM 8 +#define XCHAL_INTLEVEL4_NUM 12 +#define XCHAL_INTLEVEL5_NUM 13 +#define XCHAL_INTLEVEL7_NUM 14 +/* (There are many interrupts each at level(s) 1, 3.) */ + + +/* +* External interrupt vectors/levels. +* These macros describe how Xtensa processor interrupt numbers +* (as numbered internally, eg. in INTERRUPT and INTENABLE registers) +* map to external BInterrupt<n> pins, for those interrupts +* configured as external (level-triggered, edge-triggered, or NMI). +* See the Xtensa processor databook for more details. +*/ + +/* Core interrupt numbers mapped to each EXTERNAL interrupt number: */ +#define XCHAL_EXTINT0_NUM 0/* (intlevel 1) */ +#define XCHAL_EXTINT1_NUM 1/* (intlevel 1) */ +#define XCHAL_EXTINT2_NUM 2/* (intlevel 1) */ +#define XCHAL_EXTINT3_NUM 3/* (intlevel 1) */ +#define XCHAL_EXTINT4_NUM 4/* (intlevel 1) */ +#define XCHAL_EXTINT5_NUM 5/* (intlevel 1) */ +#define XCHAL_EXTINT6_NUM 8/* (intlevel 2) */ +#define XCHAL_EXTINT7_NUM 9/* (intlevel 3) */ +#define XCHAL_EXTINT8_NUM 12/* (intlevel 4) */ +#define XCHAL_EXTINT9_NUM 14/* (intlevel 7) */ +#define XCHAL_EXTINT10_NUM 15/* (intlevel 1) */ +#define XCHAL_EXTINT11_NUM 16/* (intlevel 1) */ +#define XCHAL_EXTINT12_NUM 17/* (intlevel 1) */ +#define XCHAL_EXTINT13_NUM 18/* (intlevel 1) */ +#define XCHAL_EXTINT14_NUM 19/* (intlevel 1) */ +#define XCHAL_EXTINT15_NUM 20/* (intlevel 1) */ +#define XCHAL_EXTINT16_NUM 21/* (intlevel 3) */ + + +/*---------------------------------------------------------------------- +EXCEPTIONS and VECTORS +----------------------------------------------------------------------*/ + +#define XCHAL_XEA_VERSION 2/* Xtensa Exception Architecture +number: 1 == XEA1 (old) +2 == XEA2 (new) +0 == XEAX (extern) */ +#define XCHAL_HAVE_XEA1 0/* Exception Architecture 1 */ +#define XCHAL_HAVE_XEA2 1/* Exception Architecture 2 */ +#define XCHAL_HAVE_XEAX 0/* External Exception Arch. */ +#define XCHAL_HAVE_EXCEPTIONS 1/* exception option */ +#define XCHAL_HAVE_MEM_ECC_PARITY 0/* local memory ECC/parity */ +#define XCHAL_HAVE_VECTOR_SELECT 1/* relocatable vectors */ +#define XCHAL_HAVE_VECBASE 1/* relocatable vectors */ +#define XCHAL_VECBASE_RESET_VADDR 0xD0000000/* VECBASE reset value */ +#define XCHAL_VECBASE_RESET_PADDR 0x00000000 +#define XCHAL_RESET_VECBASE_OVERLAP 0 + +#define XCHAL_RESET_VECTOR0_VADDR 0xFE000000 +#define XCHAL_RESET_VECTOR0_PADDR 0xFE000000 +#define XCHAL_RESET_VECTOR1_VADDR 0xD8000500 +#define XCHAL_RESET_VECTOR1_PADDR 0x00000500 +#define XCHAL_RESET_VECTOR_VADDR 0xFE000000 +#define XCHAL_RESET_VECTOR_PADDR 0xFE000000 +#define XCHAL_USER_VECOFS 0x00000340 +#define XCHAL_USER_VECTOR_VADDR 0xD0000340 +#define XCHAL_USER_VECTOR_PADDR 0x00000340 +#define XCHAL_KERNEL_VECOFS 0x00000300 +#define XCHAL_KERNEL_VECTOR_VADDR 0xD0000300 +#define XCHAL_KERNEL_VECTOR_PADDR 0x00000300 +#define XCHAL_DOUBLEEXC_VECOFS 0x000003C0 +#define XCHAL_DOUBLEEXC_VECTOR_VADDR 0xD00003C0 +#define XCHAL_DOUBLEEXC_VECTOR_PADDR 0x000003C0 +#define XCHAL_WINDOW_OF4_VECOFS 0x00000000 +#define XCHAL_WINDOW_UF4_VECOFS 0x00000040 +#define XCHAL_WINDOW_OF8_VECOFS 0x00000080 +#define XCHAL_WINDOW_UF8_VECOFS 0x000000C0 +#define XCHAL_WINDOW_OF12_VECOFS 0x00000100 +#define XCHAL_WINDOW_UF12_VECOFS 0x00000140 +#define XCHAL_WINDOW_VECTORS_VADDR 0xD0000000 +#define XCHAL_WINDOW_VECTORS_PADDR 0x00000000 +#define XCHAL_INTLEVEL2_VECOFS 0x00000180 +#define XCHAL_INTLEVEL2_VECTOR_VADDR 0xD0000180 +#define XCHAL_INTLEVEL2_VECTOR_PADDR 0x00000180 +#define XCHAL_INTLEVEL3_VECOFS 0x000001C0 +#define XCHAL_INTLEVEL3_VECTOR_VADDR 0xD00001C0 +#define XCHAL_INTLEVEL3_VECTOR_PADDR 0x000001C0 +#define XCHAL_INTLEVEL4_VECOFS 0x00000200 +#define XCHAL_INTLEVEL4_VECTOR_VADDR 0xD0000200 +#define XCHAL_INTLEVEL4_VECTOR_PADDR 0x00000200 +#define XCHAL_INTLEVEL5_VECOFS 0x00000240 +#define XCHAL_INTLEVEL5_VECTOR_VADDR 0xD0000240 +#define XCHAL_INTLEVEL5_VECTOR_PADDR 0x00000240 +#define XCHAL_INTLEVEL6_VECOFS 0x00000280 +#define XCHAL_INTLEVEL6_VECTOR_VADDR 0xD0000280 +#define XCHAL_INTLEVEL6_VECTOR_PADDR 0x00000280 +#define XCHAL_DEBUG_VECOFS XCHAL_INTLEVEL6_VECOFS +#define XCHAL_DEBUG_VECTOR_VADDR XCHAL_INTLEVEL6_VECTOR_VADDR +#define XCHAL_DEBUG_VECTOR_PADDR XCHAL_INTLEVEL6_VECTOR_PADDR +#define XCHAL_NMI_VECOFS 0x000002C0 +#define XCHAL_NMI_VECTOR_VADDR 0xD00002C0 +#define XCHAL_NMI_VECTOR_PADDR 0x000002C0 +#define XCHAL_INTLEVEL7_VECOFS XCHAL_NMI_VECOFS +#define XCHAL_INTLEVEL7_VECTOR_VADDR XCHAL_NMI_VECTOR_VADDR +#define XCHAL_INTLEVEL7_VECTOR_PADDR XCHAL_NMI_VECTOR_PADDR + + +/*---------------------------------------------------------------------- +DEBUG +----------------------------------------------------------------------*/ + +#define XCHAL_HAVE_OCD 1/* OnChipDebug option */ +#define XCHAL_NUM_IBREAK 2/* number of IBREAKn regs */ +#define XCHAL_NUM_DBREAK 2/* number of DBREAKn regs */ +#define XCHAL_HAVE_OCD_DIR_ARRAY 1/* faster OCD option */ + + +/*---------------------------------------------------------------------- +MMU +----------------------------------------------------------------------*/ + +/* See core-matmap.h header file for more details. */ + +#define XCHAL_HAVE_TLBS 1/* inverse of HAVE_CACHEATTR */ +#define XCHAL_HAVE_SPANNING_WAY 0/* one way maps I+D 4GB vaddr */ +#define XCHAL_HAVE_IDENTITY_MAP 0/* vaddr == paddr always */ +#define XCHAL_HAVE_CACHEATTR 0/* CACHEATTR register present */ +#define XCHAL_HAVE_MIMIC_CACHEATTR 0/* region protection */ +#define XCHAL_HAVE_XLT_CACHEATTR 0/* region prot. w/translation */ +#define XCHAL_HAVE_PTP_MMU 1/* full MMU (with page table +[autorefill] and protection) +usable for an MMU-based OS */ +/* If none of the above last 4 are set, it's a custom TLB configuration. */ +#define XCHAL_ITLB_ARF_ENTRIES_LOG2 2/* log2(autorefill way size) */ +#define XCHAL_DTLB_ARF_ENTRIES_LOG2 2/* log2(autorefill way size) */ + +#define XCHAL_MMU_ASID_BITS 8/* number of bits in ASIDs */ +#define XCHAL_MMU_RINGS 4/* number of rings (1..4) */ +#define XCHAL_MMU_RING_BITS 2/* num of bits in RING field */ + +#endif /* !XTENSA_HAL_NON_PRIVILEGED_ONLY */ + + +#endif /* _XTENSA_CORE_CONFIGURATION_H */ +
arch/xtensa/include/asm/arch-dc232b/tie-asm.h new file +120 -0
120 lines not on this page · raw message
arch/xtensa/include/asm/arch-dc232b/tie.h new file +129 -0
129 lines not on this page · raw message
Signature · 1 line
1.8.1.4
Max Filippov
maintainerPATCH 8/8 xtensa: add support for the 'xtfpga' evaluation board
In reply to Max FilippovFrom: Chris Zankel <[email protected]>
The 'xtfpga' board is actually a set of FPGA evaluation boards that can be configured to run an Xtensa processor.
- Avnet Xilinx LX60
- Avnet Xilinx LX110
- Avnet Xilinx LX200
- Xilinx ML605
- Xilinx KC705
These boards share the same components (open-ethernet, ns16550 serial, lcd display, flash, etc.).
--- arch/xtensa/Kconfig | 3 + board/cadence/xtfpga/Kconfig | 51 +++++++ board/cadence/xtfpga/MAINTAINERS | 6 + board/cadence/xtfpga/Makefile | 8 + board/cadence/xtfpga/README | 121 ++++++++++++++++ board/cadence/xtfpga/lcd.c | 88 +++++++++++ board/cadence/xtfpga/lcd.h | 12 ++ board/cadence/xtfpga/xtfpga.c | 173 ++++++++++++++++++++++ configs/xtfpga_defconfig | 3 + include/configs/xtfpga.h | 305 +++++++++++++++++++++++++++++++++++++++ 10 files changed, 770 insertions(+) create mode 100644 board/cadence/xtfpga/Kconfig create mode 100644 board/cadence/xtfpga/MAINTAINERS create mode 100644 board/cadence/xtfpga/Makefile create mode 100644 board/cadence/xtfpga/README create mode 100644 board/cadence/xtfpga/lcd.c create mode 100644 board/cadence/xtfpga/lcd.h create mode 100644 board/cadence/xtfpga/xtfpga.c create mode 100644 configs/xtfpga_defconfig create mode 100644 include/configs/xtfpga.h
arch/xtensa/Kconfig +3 -0
@@ -11,9 +11,12 @@ config SYS_CPU choice prompt "Target select" +config TARGET_XTFPGA + bool "Support XTFPGA" endchoice +source "board/cadence/xtfpga/Kconfig" config HAVE_SYS_ASCDISP bool
board/cadence/xtfpga/Kconfig new file +51 -0
51 lines not on this page · raw message
board/cadence/xtfpga/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@ +XTFPGA BOARD +M: Max Filippov <[email protected]> +S: Maintained +F: board/cadence/xtfpga/ +F: include/configs/xtfpga.h +F: configs/xtfpga_defconfig
board/cadence/xtfpga/Makefile new file +8 -0
@@ -0,0 +1,8 @@ +# +# (C) Copyright 2007 - 2013, Tensilica Inc. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += ${BOARD}.o +obj-$(CONFIG_SYS_ASCDISP) += lcd.o
board/cadence/xtfpga/README new file +121 -0
121 lines not on this page · raw message
board/cadence/xtfpga/lcd.c new file +88 -0
88 lines not on this page · raw message
board/cadence/xtfpga/lcd.h new file +12 -0
@@ -0,0 +1,12 @@ +/* +* Driver for the LCD display on the Tensilica LX60 Board. +* +* Copyright (C) 2001 - 2013 Tensilica Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +void lcd_init (void ); +void lcd_disp_at_pos (char *,unsigned char ); +void lcd_shiftleft (void ); +void lcd_shiftright (void );
board/cadence/xtfpga/xtfpga.c new file +173 -0
173 lines not on this page · raw message
configs/xtfpga_defconfig new file +3 -0
@@ -0,0 +1,3 @@ +CONFIG_XTENSA=y +CONFIG_SYS_CPU="dc232b" +CONFIG_XTFPGA_KC705=y
include/configs/xtfpga.h new file +305 -0
305 lines not on this page · raw message
Signature · 1 line
1.8.1.4
Max Filippov
maintainercover U-Boot port to Xtensa architecture
In reply to Max FilippovQuoted 4 lines · Max Filippov
Hi Tom,
this series adds U-Boot port to Xtensa, configurable processor architecture from Tensilica, Inc., now Cadence Design Systems Inc.
Ping?
Signature · 2 lines
Thanks. -- Max
cover U-Boot port to Xtensa architecture
Quoted 7 lines · Max Filippov
Quoted 4 lines · Max Filippov
Hi Tom,
this series adds U-Boot port to Xtensa, configurable processor architecture from Tensilica, Inc., now Cadence Design Systems Inc.
Ping?
Sorry, had a buncha things on my plate of late, I'll review the arch port soon.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140828/2adfff48/attachment.pgp>
cover U-Boot port to Xtensa architecture
In reply to Max FilippovHi Max,
Quoted 5 lines · Max Filippov
Hi Tom,
this series adds U-Boot port to Xtensa, configurable processor architecture from Tensilica, Inc., now Cadence Design Systems Inc.
Quoted 7 lines
Preparation patches clean up OpenCores 10/100 MBit driver, enable it to be used with dedicated packet memory and with gigabit PHY. Two patches add proper xtensa bits: changes to shares files and contents of
arch/xtensa. One more patch adds sample xtensa CPU configuration -- Diamond 232. One more patch adds xtfpga board family that consists of Avnet LX60, LX110 and LX200 and Xilinx ML605 and KC705 FPGA boards configured with xtensa bitstream.
Any link to bitstreams? I have ml605 and kc705 here and will be nice to test it.
Thanks,
Michal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140829/7f06e485/attachment.pgp>
Max Filippov
maintainercover U-Boot port to Xtensa architecture
Hi Michal,
Quoted 12 lines · Michal Simek
Quoted 10 lines · Max Filippov
this series adds U-Boot port to Xtensa, configurable processor architecture from Tensilica, Inc., now Cadence Design Systems Inc.
Preparation patches clean up OpenCores 10/100 MBit driver, enable it to be used with dedicated packet memory and with gigabit PHY. Two patches add proper xtensa bits: changes to shares files and contents of
arch/xtensa. One more patch adds sample xtensa CPU configuration -- Diamond 232. One more patch adds xtfpga board family that consists of Avnet LX60, LX110 and LX200 and Xilinx ML605 and KC705 FPGA boards configured with xtensa bitstream.
Quoted 1 line
Any link to bitstreams? I have ml605 and kc705 here and will be nice to test it.
The board alone is not enough to boot xtensa software, as the JTAG connector capable of loading code into CPU goes on a separate daughterboard that plugs into FMC connectors. I will check if I can share a bitstream and if it may be somehow used with the FPGA board alone.
However you should be able to test with qemu, as it simulates all necessary hardware. Some examples are listed here:
http://wiki.linux-xtensa.org/index.php/Xtensa_on_QEMU
Signature · 2 lines
Thanks. -- Max
cover U-Boot port to Xtensa architecture
Quoted 15 lines · Max Filippov
Hi Michal,
Quoted 12 lines · Michal Simek
Quoted 10 lines · Max Filippov
this series adds U-Boot port to Xtensa, configurable processor architecture from Tensilica, Inc., now Cadence Design Systems Inc.
Preparation patches clean up OpenCores 10/100 MBit driver, enable it to be used with dedicated packet memory and with gigabit PHY. Two patches add proper xtensa bits: changes to shares files and contents of
arch/xtensa. One more patch adds sample xtensa CPU configuration -- Diamond 232. One more patch adds xtfpga board family that consists of Avnet LX60, LX110 and LX200 and Xilinx ML605 and KC705 FPGA boards configured with xtensa bitstream.
Quoted 6 lines
Quoted 1 line
Any link to bitstreams? I have ml605 and kc705 here and will be nice to test it.
The board alone is not enough to boot xtensa software, as the JTAG connector capable of loading code into CPU goes on a separate daughterboard that plugs into FMC connectors. I will check if I can share a bitstream and if it may be somehow used with the FPGA board alone.
Any link to that FMC connector and connections there?
Quoted 3 lines
However you should be able to test with qemu, as it simulates all necessary hardware. Some examples are listed here:
http://wiki.linux-xtensa.org/index.php/Xtensa_on_QEMU
I am more interested to see this work on real HW than on qemu.
Thanks,
Michal
Signature · 14 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/ Maintainer of Linux kernel - Xilinx Zynq ARM architecture Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: OpenPGP digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140829/5e339e15/attachment.pgp>
Max Filippov
maintainercover U-Boot port to Xtensa architecture
Hi Michal,
Quoted 9 lines · Michal Simek
Quoted 7 lines · Max Filippov
Quoted 1 line · Michal Simek
Any link to bitstreams? I have ml605 and kc705 here and will be nice to test it.
The board alone is not enough to boot xtensa software, as the JTAG connector capable of loading code into CPU goes on a separate daughterboard that plugs into FMC connectors. I will check if I can share a bitstream and if it may be somehow used with the FPGA board alone.
Quoted 7 lines
Any link to that FMC connector and connections there?
Quoted 3 lines
However you should be able to test with qemu, as it simulates all necessary hardware. Some examples are listed here:
http://wiki.linux-xtensa.org/index.php/Xtensa_on_QEMUI am more interested to see this work on real HW than on qemu.
Tensilica IP group is willing to provide you the bitstream and the related documentation, but for its own protection it wants you to sign a license agreement. It is said to be short and written in plain language. I will provide additional details privately.
Signature · 2 lines
Thanks. -- Max