From 3f2546b2ef55b661fd8dd69682b38992225e86f6 Mon Sep 17 00:00:00 2001 From: fishsoupisgood Date: Mon, 29 Apr 2019 01:17:54 +0100 Subject: Initial import of qemu-2.4.1 --- roms/u-boot/board/davinci/dvevm/Makefile | 11 ++++ roms/u-boot/board/davinci/dvevm/board_init.S | 16 +++++ roms/u-boot/board/davinci/dvevm/config.mk | 39 ++++++++++++ roms/u-boot/board/davinci/dvevm/dvevm.c | 91 ++++++++++++++++++++++++++++ 4 files changed, 157 insertions(+) create mode 100644 roms/u-boot/board/davinci/dvevm/Makefile create mode 100644 roms/u-boot/board/davinci/dvevm/board_init.S create mode 100644 roms/u-boot/board/davinci/dvevm/config.mk create mode 100644 roms/u-boot/board/davinci/dvevm/dvevm.c (limited to 'roms/u-boot/board/davinci/dvevm') diff --git a/roms/u-boot/board/davinci/dvevm/Makefile b/roms/u-boot/board/davinci/dvevm/Makefile new file mode 100644 index 00000000..7ade3259 --- /dev/null +++ b/roms/u-boot/board/davinci/dvevm/Makefile @@ -0,0 +1,11 @@ +# +# (C) Copyright 2000, 2001, 2002 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de. +# +# Copyright (C) 2007 Sergey Kubushyn +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y := dvevm.o +obj-y += board_init.o diff --git a/roms/u-boot/board/davinci/dvevm/board_init.S b/roms/u-boot/board/davinci/dvevm/board_init.S new file mode 100644 index 00000000..ded05900 --- /dev/null +++ b/roms/u-boot/board/davinci/dvevm/board_init.S @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2007 Sergey Kubushyn + * + * Board-specific low level initialization code. Called at the very end + * of arch/arm/cpu/arm926ejs/davinci/lowlevel_init.S. Just returns if there is no + * initialization required. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include + +.globl dv_board_init +dv_board_init: + + mov pc, lr diff --git a/roms/u-boot/board/davinci/dvevm/config.mk b/roms/u-boot/board/davinci/dvevm/config.mk new file mode 100644 index 00000000..ed807072 --- /dev/null +++ b/roms/u-boot/board/davinci/dvevm/config.mk @@ -0,0 +1,39 @@ +# +# (C) Copyright 2002 +# Gary Jennejohn, DENX Software Engineering, +# David Mueller, ELSOFT AG, +# +# (C) Copyright 2003 +# Texas Instruments, +# Swaminathan +# +# Davinci EVM board (ARM925EJS) cpu +# see http://www.ti.com/ for more information on Texas Instruments +# +# Davinci EVM has 1 bank of 256 MB DDR RAM +# Physical Address: +# 8000'0000 to 9000'0000 +# +# Copyright (C) 2007 Sergey Kubushyn +# +# Visioneering Corp. Sonata board (ARM926EJS) cpu +# +# Sonata board has 1 bank of 128 MB DDR RAM +# Physical Address: +# 8000'0000 to 8800'0000 +# +# Razorstream, LLC. SCHMOOGIE board (ARM926EJS) cpu +# +# Schmoogie board has 1 bank of 128 MB DDR RAM +# Physical Address: +# 8000'0000 to 8800'0000 +# +# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000 +# (mem base + reserved) +# +# we load ourself to 8108 '0000 +# +# + +#Provide at least 16MB spacing between us and the Linux Kernel image +CONFIG_SYS_TEXT_BASE = 0x81080000 diff --git a/roms/u-boot/board/davinci/dvevm/dvevm.c b/roms/u-boot/board/davinci/dvevm/dvevm.c new file mode 100644 index 00000000..c34bde4f --- /dev/null +++ b/roms/u-boot/board/davinci/dvevm/dvevm.c @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2007 Sergey Kubushyn + * + * Parts are shamelessly stolen from various TI sources, original copyright + * follows: + * ----------------------------------------------------------------- + * + * Copyright (C) 2004 Texas Instruments. + * + * ---------------------------------------------------------------------------- + * SPDX-License-Identifier: GPL-2.0+ + * ---------------------------------------------------------------------------- + */ + +#include +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +int board_init(void) +{ + /* arch number of the board */ + gd->bd->bi_arch_number = MACH_TYPE_DAVINCI_EVM; + + /* address of boot parameters */ + gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR; + + /* Configure AEMIF pins (although this should be configured at boot time + * with pull-up/pull-down resistors) */ + REG(PINMUX0) = 0x00000c1f; + + davinci_errata_workarounds(); + + /* Power on required peripherals */ + lpsc_on(DAVINCI_LPSC_GPIO); + lpsc_on(DAVINCI_LPSC_USB); + +#if !defined(CONFIG_SYS_USE_DSPLINK) + /* Powerup the DSP */ + dsp_on(); +#endif /* CONFIG_SYS_USE_DSPLINK */ + + davinci_enable_uart0(); + davinci_enable_emac(); + davinci_enable_i2c(); + + lpsc_on(DAVINCI_LPSC_TIMER1); + timer_init(); + + return(0); +} + +int misc_init_r(void) +{ + uint8_t video_mode; + uint8_t eeprom_enetaddr[6]; + + /* Read Ethernet MAC address from EEPROM if available. */ + if (dvevm_read_mac_address(eeprom_enetaddr)) + davinci_sync_env_enetaddr(eeprom_enetaddr); + + i2c_read(0x39, 0x00, 1, &video_mode, 1); + + setenv("videostd", ((video_mode & 0x80) ? "pal" : "ntsc")); + + return(0); +} + +#ifdef CONFIG_USB_DAVINCI + +/* IO Expander I2C address and USB VBUS enable mask */ +#define IOEXP_I2C_ADDR 0x3A +#define IOEXP_VBUSEN_MASK 1 + +/* + * This function enables USB VBUS by writting to IO expander using I2C. + * Note that the I2C is already initialized at this stage. This + * function is used by davinci specific USB wrapper code. + */ +void enable_vbus(void) +{ + uchar data; /* IO Expander data to enable VBUS */ + + /* Write to IO expander to enable VBUS */ + i2c_read(IOEXP_I2C_ADDR, 0, 0, &data, 1); + data &= ~IOEXP_VBUSEN_MASK; + i2c_write(IOEXP_I2C_ADDR, 0, 0, &data, 1); +} +#endif -- cgit v1.2.3