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:
9
u-boot/board/cm-bf537e/Kconfig
Normal file
9
u-boot/board/cm-bf537e/Kconfig
Normal file
@@ -0,0 +1,9 @@
|
||||
if TARGET_CM_BF537E
|
||||
|
||||
config SYS_BOARD
|
||||
default "cm-bf537e"
|
||||
|
||||
config SYS_CONFIG_NAME
|
||||
default "cm-bf537e"
|
||||
|
||||
endif
|
||||
6
u-boot/board/cm-bf537e/MAINTAINERS
Normal file
6
u-boot/board/cm-bf537e/MAINTAINERS
Normal file
@@ -0,0 +1,6 @@
|
||||
CM-BF537E BOARD
|
||||
#M: Bluetechnix Tinyboards <bluetechnix@blackfin.uclinux.org>
|
||||
S: Orphan (since 2014-03)
|
||||
F: board/cm-bf537e/
|
||||
F: include/configs/cm-bf537e.h
|
||||
F: configs/cm-bf537e_defconfig
|
||||
12
u-boot/board/cm-bf537e/Makefile
Normal file
12
u-boot/board/cm-bf537e/Makefile
Normal file
@@ -0,0 +1,12 @@
|
||||
#
|
||||
# U-Boot - Makefile
|
||||
#
|
||||
# Copyright (c) 2005-2008 Analog Device Inc.
|
||||
#
|
||||
# (C) Copyright 2000-2006
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-y := cm-bf537e.o gpio_cfi_flash.o
|
||||
44
u-boot/board/cm-bf537e/cm-bf537e.c
Normal file
44
u-boot/board/cm-bf537e/cm-bf537e.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* U-Boot - main board file
|
||||
*
|
||||
* Copyright (c) 2005-2009 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <config.h>
|
||||
#include <command.h>
|
||||
#include <net.h>
|
||||
#include <netdev.h>
|
||||
#include <asm/blackfin.h>
|
||||
#include "gpio_cfi_flash.h"
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
int checkboard(void)
|
||||
{
|
||||
printf("Board: Bluetechnix CM-BF537E board\n");
|
||||
printf(" Support: http://www.bluetechnix.at/\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_BFIN_MAC
|
||||
# define bfin_EMAC_initialize(x) 1
|
||||
#endif
|
||||
#ifndef CONFIG_SMC911X
|
||||
# define smc911x_initialize(n, x) 1
|
||||
#endif
|
||||
int board_eth_init(bd_t *bis)
|
||||
{
|
||||
/* return ok if at least 1 eth device works */
|
||||
return bfin_EMAC_initialize(bis) &
|
||||
smc911x_initialize(0, CONFIG_SMC911X_BASE);
|
||||
}
|
||||
|
||||
int misc_init_r(void)
|
||||
{
|
||||
gpio_cfi_flash_init();
|
||||
|
||||
return 0;
|
||||
}
|
||||
11
u-boot/board/cm-bf537e/config.mk
Normal file
11
u-boot/board/cm-bf537e/config.mk
Normal file
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2005-2008 Analog Device Inc.
|
||||
#
|
||||
# (C) Copyright 2001
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
# Set some default LDR flags based on boot mode.
|
||||
LDR_FLAGS-BFIN_BOOT_PARA := --bits 16 --dma 8
|
||||
81
u-boot/board/cm-bf537e/gpio_cfi_flash.c
Normal file
81
u-boot/board/cm-bf537e/gpio_cfi_flash.c
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* gpio_cfi_flash.c - GPIO-assisted Flash Chip Support
|
||||
*
|
||||
* Copyright (c) 2009-2010 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/blackfin.h>
|
||||
#include <asm/gpio.h>
|
||||
#include <asm/io.h>
|
||||
#include "gpio_cfi_flash.h"
|
||||
|
||||
/* Allow this driver to be shared among boards */
|
||||
#ifndef GPIO_PIN_1
|
||||
#define GPIO_PIN_1 GPIO_PF4
|
||||
#endif
|
||||
#define GPIO_MASK_1 (1 << 21)
|
||||
#ifndef GPIO_PIN_2
|
||||
#define GPIO_MASK_2 (0)
|
||||
#else
|
||||
#define GPIO_MASK_2 (1 << 22)
|
||||
#endif
|
||||
#ifndef GPIO_PIN_3
|
||||
#define GPIO_MASK_3 (0)
|
||||
#else
|
||||
#define GPIO_MASK_3 (1 << 23)
|
||||
#endif
|
||||
#define GPIO_MASK (GPIO_MASK_1 | GPIO_MASK_2 | GPIO_MASK_3)
|
||||
|
||||
void *gpio_cfi_flash_swizzle(void *vaddr)
|
||||
{
|
||||
unsigned long addr = (unsigned long)vaddr;
|
||||
|
||||
gpio_set_value(GPIO_PIN_1, addr & GPIO_MASK_1);
|
||||
|
||||
#ifdef GPIO_PIN_2
|
||||
gpio_set_value(GPIO_PIN_2, addr & GPIO_MASK_2);
|
||||
#endif
|
||||
|
||||
#ifdef GPIO_PIN_3
|
||||
gpio_set_value(GPIO_PIN_3, addr & GPIO_MASK_3);
|
||||
#endif
|
||||
|
||||
SSYNC();
|
||||
udelay(1);
|
||||
|
||||
return (void *)(addr & ~GPIO_MASK);
|
||||
}
|
||||
|
||||
#define __raw_writeq(value, addr) *(volatile u64 *)addr = value
|
||||
#define __raw_readq(addr) *(volatile u64 *)addr
|
||||
|
||||
#define MAKE_FLASH(size, sfx) \
|
||||
void flash_write##size(u##size value, void *addr) \
|
||||
{ \
|
||||
__raw_write##sfx(value, gpio_cfi_flash_swizzle(addr)); \
|
||||
} \
|
||||
u##size flash_read##size(void *addr) \
|
||||
{ \
|
||||
return __raw_read##sfx(gpio_cfi_flash_swizzle(addr)); \
|
||||
}
|
||||
MAKE_FLASH(8, b) /* flash_write8() flash_read8() */
|
||||
MAKE_FLASH(16, w) /* flash_write16() flash_read16() */
|
||||
MAKE_FLASH(32, l) /* flash_write32() flash_read32() */
|
||||
MAKE_FLASH(64, q) /* flash_write64() flash_read64() */
|
||||
|
||||
void gpio_cfi_flash_init(void)
|
||||
{
|
||||
gpio_request(GPIO_PIN_1, "gpio_cfi_flash");
|
||||
gpio_direction_output(GPIO_PIN_1, 0);
|
||||
#ifdef GPIO_PIN_2
|
||||
gpio_request(GPIO_PIN_2, "gpio_cfi_flash");
|
||||
gpio_direction_output(GPIO_PIN_2, 0);
|
||||
#endif
|
||||
#ifdef GPIO_PIN_3
|
||||
gpio_request(GPIO_PIN_3, "gpio_cfi_flash");
|
||||
gpio_direction_output(GPIO_PIN_3, 0);
|
||||
#endif
|
||||
}
|
||||
10
u-boot/board/cm-bf537e/gpio_cfi_flash.h
Normal file
10
u-boot/board/cm-bf537e/gpio_cfi_flash.h
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* gpio_cfi_flash.c - GPIO-assisted Flash Chip Support
|
||||
*
|
||||
* Copyright (c) 2009 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
void *gpio_cfi_flash_swizzle(void *vaddr);
|
||||
void gpio_cfi_flash_init(void);
|
||||
Reference in New Issue
Block a user