avionic design with actual uboot and tooling
submodule of avionic design uboot bootloader and with included tools to get you started , read readme.md and readme-tk1-loader.md
This commit is contained in:
36
u-boot/board/xilinx/microblaze-generic/Kconfig
Normal file
36
u-boot/board/xilinx/microblaze-generic/Kconfig
Normal file
@@ -0,0 +1,36 @@
|
||||
if TARGET_MICROBLAZE_GENERIC
|
||||
|
||||
config SYS_BOARD
|
||||
default "microblaze-generic"
|
||||
|
||||
config SYS_VENDOR
|
||||
default "xilinx"
|
||||
|
||||
config SYS_CONFIG_NAME
|
||||
default "microblaze-generic"
|
||||
|
||||
config XILINX_MICROBLAZE0_USE_MSR_INSTR
|
||||
int "USE_MSR_INSTR range (0:1)"
|
||||
default 0
|
||||
|
||||
config XILINX_MICROBLAZE0_USE_PCMP_INSTR
|
||||
int "USE_PCMP_INSTR range (0:1)"
|
||||
default 0
|
||||
|
||||
config XILINX_MICROBLAZE0_USE_BARREL
|
||||
int "USE_BARREL range (0:1)"
|
||||
default 0
|
||||
|
||||
config XILINX_MICROBLAZE0_USE_DIV
|
||||
int "USE_DIV range (0:1)"
|
||||
default 0
|
||||
|
||||
config XILINX_MICROBLAZE0_USE_HW_MUL
|
||||
int "USE_HW_MUL values (0=NONE, 1=MUL32, 2=MUL64)"
|
||||
default 0
|
||||
|
||||
config XILINX_MICROBLAZE0_HW_VER
|
||||
string "Core version number"
|
||||
default 7.10.d
|
||||
|
||||
endif
|
||||
6
u-boot/board/xilinx/microblaze-generic/MAINTAINERS
Normal file
6
u-boot/board/xilinx/microblaze-generic/MAINTAINERS
Normal file
@@ -0,0 +1,6 @@
|
||||
MICROBLAZE-GENERIC BOARD
|
||||
M: Michal Simek <monstr@monstr.eu>
|
||||
S: Maintained
|
||||
F: board/xilinx/microblaze-generic/
|
||||
F: include/configs/microblaze-generic.h
|
||||
F: configs/microblaze-generic_defconfig
|
||||
8
u-boot/board/xilinx/microblaze-generic/Makefile
Normal file
8
u-boot/board/xilinx/microblaze-generic/Makefile
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
# (C) Copyright 2000-2006
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-y = microblaze-generic.o
|
||||
20
u-boot/board/xilinx/microblaze-generic/config.mk
Normal file
20
u-boot/board/xilinx/microblaze-generic/config.mk
Normal file
@@ -0,0 +1,20 @@
|
||||
#
|
||||
# (C) Copyright 2007 - 2016 Michal Simek
|
||||
#
|
||||
# Michal SIMEK <monstr@monstr.eu>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
CPU_VER := $(shell echo $(CONFIG_XILINX_MICROBLAZE0_HW_VER))
|
||||
|
||||
# USE_HW_MUL can be 0, 1, or 2, defining a hierarchy of HW Mul support.
|
||||
CPUFLAGS-$(subst 1,,$(CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL)) += -mxl-multiply-high
|
||||
CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL) += -mno-xl-soft-mul
|
||||
CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_DIV) += -mno-xl-soft-div
|
||||
CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_BARREL) += -mxl-barrel-shift
|
||||
CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare
|
||||
|
||||
CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER))
|
||||
|
||||
PLATFORM_CPPFLAGS += $(CPUFLAGS-1) $(CPUFLAGS-2)
|
||||
94
u-boot/board/xilinx/microblaze-generic/microblaze-generic.c
Normal file
94
u-boot/board/xilinx/microblaze-generic/microblaze-generic.c
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* (C) Copyright 2007 Michal Simek
|
||||
*
|
||||
* Michal SIMEK <monstr@monstr.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/* This is a board specific file. It's OK to include board specific
|
||||
* header files */
|
||||
|
||||
#include <common.h>
|
||||
#include <config.h>
|
||||
#include <fdtdec.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/microblaze_intc.h>
|
||||
#include <asm/asm.h>
|
||||
#include <asm/gpio.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#ifdef CONFIG_XILINX_GPIO
|
||||
static int reset_pin = -1;
|
||||
#endif
|
||||
|
||||
ulong ram_base;
|
||||
|
||||
void dram_init_banksize(void)
|
||||
{
|
||||
gd->bd->bi_dram[0].start = ram_base;
|
||||
gd->bd->bi_dram[0].size = get_effective_memsize();
|
||||
}
|
||||
|
||||
int dram_init(void)
|
||||
{
|
||||
int node;
|
||||
fdt_addr_t addr;
|
||||
fdt_size_t size;
|
||||
const void *blob = gd->fdt_blob;
|
||||
|
||||
node = fdt_node_offset_by_prop_value(blob, -1, "device_type",
|
||||
"memory", 7);
|
||||
if (node == -FDT_ERR_NOTFOUND) {
|
||||
debug("DRAM: Can't get memory node\n");
|
||||
return 1;
|
||||
}
|
||||
addr = fdtdec_get_addr_size(blob, node, "reg", &size);
|
||||
if (addr == FDT_ADDR_T_NONE || size == 0) {
|
||||
debug("DRAM: Can't get base address or size\n");
|
||||
return 1;
|
||||
}
|
||||
ram_base = addr;
|
||||
|
||||
gd->ram_top = addr; /* In setup_dest_addr() is done +ram_size */
|
||||
gd->ram_size = size;
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
#ifndef CONFIG_SPL_BUILD
|
||||
#ifdef CONFIG_XILINX_GPIO
|
||||
if (reset_pin != -1)
|
||||
gpio_direction_output(reset_pin, 1);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_XILINX_TB_WATCHDOG
|
||||
hw_watchdog_disable();
|
||||
#endif
|
||||
#endif
|
||||
puts ("Reseting board\n");
|
||||
__asm__ __volatile__ (" mts rmsr, r0;" \
|
||||
"bra r0");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gpio_init(void)
|
||||
{
|
||||
#ifdef CONFIG_XILINX_GPIO
|
||||
reset_pin = gpio_alloc(CONFIG_SYS_GPIO_0_ADDR, "reset", 1);
|
||||
if (reset_pin != -1)
|
||||
gpio_request(reset_pin, "reset_pin");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_late_init(void)
|
||||
{
|
||||
gpio_init();
|
||||
|
||||
return 0;
|
||||
}
|
||||
28
u-boot/board/xilinx/microblaze-generic/xparameters.h
Normal file
28
u-boot/board/xilinx/microblaze-generic/xparameters.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* (C) Copyright 2007 Michal Simek
|
||||
*
|
||||
* Michal SIMEK <monstr@monstr.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*
|
||||
* CAUTION: This file is a faked configuration !!!
|
||||
* There is no real target for the microblaze-generic
|
||||
* configuration. You have to replace this file with
|
||||
* the generated file from your Xilinx design flow.
|
||||
*/
|
||||
|
||||
#define XILINX_BOARD_NAME microblaze-generic
|
||||
|
||||
/* Microblaze is microblaze_0 */
|
||||
#define XILINX_FSL_NUMBER 3
|
||||
|
||||
/* GPIO is LEDs_4Bit*/
|
||||
#define XILINX_GPIO_BASEADDR 0x40000000
|
||||
|
||||
/* Flash Memory is FLASH_2Mx32 */
|
||||
#define XILINX_FLASH_START 0x2c000000
|
||||
#define XILINX_FLASH_SIZE 0x00800000
|
||||
|
||||
/* Watchdog IP is wxi_timebase_wdt_0 */
|
||||
#define XILINX_WATCHDOG_BASEADDR 0x50000000
|
||||
#define XILINX_WATCHDOG_IRQ 1
|
||||
Reference in New Issue
Block a user