9
0
Fork 0

Merge branch 'next'

This commit is contained in:
Sascha Hauer 2011-02-03 10:49:18 +01:00
commit 06ea6c135d
166 changed files with 3263 additions and 2230 deletions

11
Kconfig Normal file
View File

@ -0,0 +1,11 @@
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "Linux/$ARCH $KERNELVERSION Barebox Configuration"
config SRCARCH
string
option env="SRCARCH"
source "arch/$SRCARCH/Kconfig"

View File

@ -39,8 +39,8 @@ config ARCH_IMX
bool "Freescale iMX-based"
select GENERIC_GPIO
config ARCH_STM
bool "SigmaTel/FSL iMX-based"
config ARCH_MXS
bool "Freescale i.MX23/28 (mxs) based"
select GENERIC_GPIO
config ARCH_NETX
@ -71,13 +71,16 @@ source arch/arm/cpu/Kconfig
source arch/arm/mach-at91/Kconfig
source arch/arm/mach-ep93xx/Kconfig
source arch/arm/mach-imx/Kconfig
source arch/arm/mach-stm/Kconfig
source arch/arm/mach-mxs/Kconfig
source arch/arm/mach-netx/Kconfig
source arch/arm/mach-nomadik/Kconfig
source arch/arm/mach-omap/Kconfig
source arch/arm/mach-s3c24xx/Kconfig
source arch/arm/mach-versatile/Kconfig
config ARM_ASM_UNIFIED
bool
config AEABI
bool "Use the ARM EABI to compile barebox"
help

View File

@ -35,13 +35,14 @@ CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-th
endif
CPPFLAGS += $(CFLAGS_ABI) $(arch-y) $(tune-y)
AFLAGS += -include asm/unified.h
# Machine directory name. This list is sorted alphanumerically
# by CONFIG_* macro name.
machine-$(CONFIG_ARCH_AT91) := at91
machine-$(CONFIG_ARCH_EP93XX) := ep93xx
machine-$(CONFIG_ARCH_IMX) := imx
machine-$(CONFIG_ARCH_STM) := stm
machine-$(CONFIG_ARCH_MXS) := mxs
machine-$(CONFIG_ARCH_NOMADIK) := nomadik
machine-$(CONFIG_ARCH_NETX) := netx
machine-$(CONFIG_ARCH_OMAP) := omap

View File

@ -40,6 +40,26 @@
#include <mach/at91sam9_smc.h>
#include <mach/sam9_smc.h>
/*
* board revision encoding
* bit 0-3: lcd type
* 0 => truly TFT1N4633-E (sam9m10g45-ek)
* 1 => LG philips LB043WQ1 (sam9m10-ekes and sam9g45-ekes)
*/
#define HAVE_LCD_TRULY_TFT1N4633E (0 << 0)
#define HAVE_LCD_LG_LB043WQ1 (1 << 0)
static void ek_set_board_revision(void)
{
u32 rev;
#ifdef CONFIG_LCD_LG_LB043WQ1
rev = HAVE_LCD_LG_LB043WQ1;
#else
rev = HAVE_LCD_TRULY_TFT1N4633E;
#endif
armlinux_set_revision(rev);
}
static struct atmel_nand_data nand_pdata = {
.ale = 21,
.cle = 22,
@ -103,6 +123,7 @@ static int at91sam9m10g45ek_devices_init(void)
armlinux_set_bootparams((void *)(AT91_CHIPSELECT_6 + 0x100));
armlinux_set_architecture(MACH_TYPE_AT91SAM9M10G45EK);
ek_set_board_revision();
return 0;
}

View File

@ -22,13 +22,16 @@
#include <environment.h>
#include <errno.h>
#include <mci.h>
#include <usb/ehci.h>
#include <asm/armlinux.h>
#include <asm/io.h>
#include <asm/mmu.h>
#include <generated/mach-types.h>
#include <mach/imx-regs.h>
#include <mach/clock.h>
#include <mach/mci.h>
#include <mach/fb.h>
#include <mach/usb.h>
static struct memory_platform_data ram_pdata = {
.name = "ram0",
@ -54,6 +57,22 @@ static struct device_d mci_dev = {
.platform_data = &mci_pdata,
};
#define GPIO_LCD_RESET 50
#define GPIO_LCD_BACKLIGHT 60
static void chumby_fb_enable(int enable)
{
gpio_direction_output(GPIO_LCD_RESET, enable);
/* Give the display a chance to sync before we enable
* the backlight to avoid flickering
*/
if (enable)
mdelay(100);
gpio_direction_output(GPIO_LCD_BACKLIGHT, enable);
}
static struct fb_videomode falconwing_vmode = {
/*
* Nanovision NMA35QV65-B2-K01 (directly connected)
@ -79,11 +98,12 @@ static struct fb_videomode falconwing_vmode = {
.flag = 0,
};
static struct imx_fb_videomode fb_mode = {
static struct imx_fb_platformdata fb_mode = {
.mode_list = &falconwing_vmode,
.mode_cnt = 1,
/* the NMA35 is a 24 bit display, but only 18 bits are connected */
.ld_intf_width = STMLCDIF_18BIT,
.enable = chumby_fb_enable,
};
static struct device_d ldcif_dev = {
@ -197,10 +217,10 @@ static const uint32_t pad_setup[] = {
/* backlight control, to be controled by PWM, here we only want to disable it */
PWM2_GPIO | GPIO_OUT | GPIO_VALUE(0), /* 1 enables, 0 disables the backlight */
/* send a reset signal to the USB hub */
/* USB hub reset (active low) */
AUART1_TX_GPIO | GPIO_OUT | GPIO_VALUE(0),
/* USB power disable (FIXME what level to be switched off) */
/* USB power (active high) */
AUART1_CTS_GPIO | GPIO_OUT | GPIO_VALUE(0),
/* Detecting if a display is connected (0 = display attached) (external pull up) */
@ -262,6 +282,28 @@ static const uint32_t pad_setup[] = {
GPMI_RDY3_GPIO | GPIO_IN | PULLUP(1),
};
#ifdef CONFIG_MMU
static int falconwing_mmu_init(void)
{
mmu_init();
arm_create_section(0x40000000, 0x40000000, 64, PMD_SECT_DEF_CACHED);
arm_create_section(0x50000000, 0x40000000, 64, PMD_SECT_DEF_UNCACHED);
setup_dma_coherent(0x10000000);
#if TEXT_BASE & (0x100000 - 1)
#warning cannot create vector section. Adjust TEXT_BASE to a 1M boundary
#else
arm_create_section(0x0, TEXT_BASE, 1, PMD_SECT_DEF_UNCACHED);
#endif
mmu_enable();
return 0;
}
postcore_initcall(falconwing_mmu_init);
#endif
/**
* Try to register an environment storage on the attached MCI card
* @return 0 on success
@ -298,6 +340,35 @@ static int register_persistant_environment(void)
return devfs_add_partition("disk0.1", 0, cdev->size, DEVFS_PARTITION_FIXED, "env0");
}
static struct ehci_platform_data chumby_usb_pdata = {
.flags = EHCI_HAS_TT,
.hccr_offset = 0x100,
.hcor_offset = 0x140,
};
static struct device_d usb_dev = {
.name = "ehci",
.id = -1,
.map_base = IMX_USB_BASE,
.size = 0x200,
.platform_data = &chumby_usb_pdata,
};
#define GPIO_USB_HUB_RESET 29
#define GPIO_USB_HUB_POWER 26
static void falconwing_init_usb(void)
{
/* power USB hub */
gpio_direction_output(GPIO_USB_HUB_POWER, 1);
mdelay(1);
/* bring USB hub out of reset */
gpio_direction_output(GPIO_USB_HUB_RESET, 1);
imx_usb_phy_enable();
register_device(&usb_dev);
}
static int falconwing_devices_init(void)
{
int i, rc;
@ -313,6 +384,8 @@ static int falconwing_devices_init(void)
register_device(&mci_dev);
register_device(&ldcif_dev);
falconwing_init_usb();
armlinux_add_dram(&sdram_dev);
armlinux_set_bootparams((void*)(sdram_dev.map_base + 0x100));
armlinux_set_architecture(MACH_TYPE_CHUMBY);

View File

@ -1,36 +0,0 @@
#!/bin/sh
if [ -z "$part" -o -z "$image" ]; then
echo "define \$part and \$image"
exit 1
fi
if [ ! -e "$part" ]; then
echo "Partition $part does not exist"
exit 1
fi
if [ $# = 1 ]; then
image=$1
fi
if [ x$ip = xdhcp ]; then
dhcp
fi
ping $eth0.serverip
if [ $? -ne 0 ] ; then
echo "update aborted"
exit 1
fi
unprotect $part
echo
echo "erasing partition $part"
erase $part
echo
echo "flashing $image to $part"
echo
tftp $image $part

View File

@ -1,53 +0,0 @@
#!/bin/sh
. /env/config
if [ x$1 = xjffS2 ]; then
root=jffs2
kernel=nand
fi
if [ x$1 = xubifs ]; then
root=ubifs
kernel=nand
fi
if [ x$1 = xnet ]; then
root=net
kernel=net
fi
if [ x$ip = xdhcp ]; then
bootargs="$bootargs ip=dhcp"
else
if [ x$ip = xoff ]; then
bootargs="$bootargs ip=off"
else
bootargs="$bootargs ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask:::"
fi
fi
if [ x$root = xjffs2 ]; then
bootargs="$bootargs root=/dev/mtdblock$rootpartnum_nand rootfstype=jffs2"
fi
if [ x$root = xubifs ]; then
bootargs="$bootargs root=ubi0:$ubiroot ubi.mtd=$rootpartnum_nand rootfstype=ubifs"
fi
if [ x$root = xnet ]; then
bootargs="$bootargs root=/dev/nfs nfsroot=$eth0.serverip:$nfsroot,v3,tcp"
fi
bootargs="$bootargs mtdparts=mxc_nand:$nand_parts"
if [ $kernel = net ]; then
if [ x$ip = xdhcp ]; then
dhcp
fi
tftp $uimage uImage || exit 1
bootm uImage
else
bootm /dev/nand0.kernel.bb
fi

View File

@ -1 +0,0 @@
nand -a /dev/nand0.*

View File

@ -1,43 +0,0 @@
#!/bin/sh
PATH=/env/bin
export PATH
. /env/config
if [ -e /dev/nand0 ]; then
addpart /dev/nand0 $nand_parts
# Uh, oh, hush first expands wildcards and then starts executing
# commands. What a bug!
source /env/bin/hush_hack
fi
if [ -f /env/logo.bmp ]; then
bmp /env/logo.bmp
fb0.enable=1
elif [ -f /env/logo.bmp.lzo ]; then
unlzo /env/logo.bmp.lzo /logo.bmp
bmp /logo.bmp
fb0.enable=1
fi
if [ -z $eth0.ethaddr ]; then
while [ -z $eth0.ethaddr ]; do
readline "no MAC address set for eth0. please enter the one found on your board: " eth0.ethaddr
done
echo -a /env/config "eth0.ethaddr=$eth0.ethaddr"
saveenv
fi
echo
echo -n "Hit any key to stop autoboot: "
timeout -a $autoboot_timeout
if [ $? != 0 ]; then
echo
echo "type update_kernel [<imagename>] to update kernel into flash"
echo "type update_root [<imagename>] to update rootfs into flash"
echo
exit
fi
boot

View File

@ -0,0 +1,18 @@
#!/bin/sh
if [ -f /env/logo.bmp ]; then
bmp /env/logo.bmp
fb0.enable=1
elif [ -f /env/logo.bmp.lzo ]; then
unlzo /env/logo.bmp.lzo /logo.bmp
bmp /logo.bmp
fb0.enable=1
fi
if [ -z $eth0.ethaddr ]; then
while [ -z $eth0.ethaddr ]; do
readline "no MAC address set for eth0. please enter the one found on your board: " eth0.ethaddr
done
echo -a /env/config "eth0.ethaddr=$eth0.ethaddr"
saveenv
fi

View File

@ -1,8 +0,0 @@
#!/bin/sh
. /env/config
image=$uimage
part=/dev/nand0.kernel.bb
. /env/bin/_update $1

View File

@ -1,8 +0,0 @@
#!/bin/sh
. /env/config
image=$rootfs
part=/dev/nand0.root.bb
. /env/bin/_update $1

View File

@ -1,27 +1,48 @@
#!/bin/sh
# can be either 'net' or 'jffs2' or 'ubifs'
kernel=nand
root=ubifs
# otg port mode : can be 'host' or 'device'
otg_mode="device"
basedir=cpuimx25
uimage=$basedir/uImage
rootfs=$basedir/rootfs
autoboot_timeout=1
nfsroot=""
bootargs="console=ttymxc0,115200"
nand_parts="256k(barebox)ro,128k(bareboxenv),2432k(kernel),-(root)"
rootpartnum_nand=3
ubiroot="eukrea-cpuimx25-rootfs"
machine=eukrea-cpuimx25
# use 'dhcp' to do dhcp in barebox and in kernel
ip=off
# use 'none' if you want to skip kernel ip autoconfiguration
ip=none
# or set your networking parameters here
#eth0.ipaddr=a.b.c.d
#eth0.netmask=a.b.c.d
#eth0.gateway=a.b.c.d
#eth0.serverip=a.b.c.d
# can be either 'net' or 'nand'
kernel_loc=nand
# can be either 'net', 'nand' or 'initrd'
rootfs_loc=nand
# rootfs
rootfs_type=ubifs
rootfsimage=$machine/rootfs.$rootfs_type
# kernel
kernelimage_type=uimage
kernelimage=$machine/uImage-${machine}.bin
# barebox and it's env
bareboximage=$machine/barebox-${machine}.bin
bareboxenvimage=$machine/bareboxenv-${machine}.bin
nfsroot="$eth0.serverip:/srv/nfs/$machine"
autoboot_timeout=1
bootargs="console=ttymxc0,115200 otg_mode=$otg_mode"
nand_parts="256k(barebox)ro,128k(bareboxenv),3M(kernel),-(root)"
rootfs_mtdblock_nand=3
nand_device="mxc_nand"
ubiroot="$machine-rootfs"
device_type="nand"
# set a fancy prompt (if support is compiled in)
PS1="\e[1;32mbarebox@\e[1;31m\h:\w\e[0m "

View File

@ -31,6 +31,7 @@
#include <mach/gpio.h>
#include <asm/io.h>
#include <asm/mmu.h>
#include <led.h>
#include <partition.h>
#include <generated/mach-types.h>
@ -132,6 +133,11 @@ static struct imx_fb_platform_data eukrea_cpuimx25_fb_data = {
.dmacr = 0x80040060,
};
struct gpio_led led0 = {
.gpio = 2 * 32 + 19,
.active_low = 1,
};
#ifdef CONFIG_USB
static void imx25_usb_init(void)
{
@ -243,6 +249,8 @@ static struct pad_desc eukrea_cpuimx25_pads[] = {
MX25_PAD_SD1_DATA1__DAT1,
MX25_PAD_SD1_DATA2__DAT2,
MX25_PAD_SD1_DATA3__DAT3,
/* LED */
MX25_PAD_POWER_FAIL__GPIO19,
};
static int eukrea_cpuimx25_devices_init(void)
@ -252,6 +260,8 @@ static int eukrea_cpuimx25_devices_init(void)
mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx25_pads,
ARRAY_SIZE(eukrea_cpuimx25_pads));
led_gpio_register(&led0);
imx25_add_fec(&fec_info);
nand_info.width = 1;
@ -271,6 +281,9 @@ static int eukrea_cpuimx25_devices_init(void)
gpio_direction_output(26, 1);
gpio_set_value(26, 1);
/* LED : default OFF */
gpio_direction_output(2 * 32 + 19, 1);
imx25_add_fb(&eukrea_cpuimx25_fb_data);
imx25_add_i2c0(NULL);

View File

@ -19,7 +19,10 @@
#include <errno.h>
#include <mci.h>
#include <fec.h>
#include <sizes.h>
#include <reloc.h>
#include <asm/io.h>
#include <asm/sections.h>
#include <mach/imx-regs.h>
#include <mach/clock.h>
#include <mach/mci.h>
@ -181,11 +184,15 @@ static struct fb_videomode tx28evk_vmodes[] = {
},
};
#define MAX_FB_SIZE SZ_2M
static struct imx_fb_videomode imxfb_mode = {
.mode_list = tx28evk_vmodes,
.mode_cnt = ARRAY_SIZE(tx28evk_vmodes),
.dotclk_delay = 0, /* no adaption required */
.ld_intf_width = STMLCDIF_24BIT, /* full 24 bit */
.fixed_screen = (void *)(0x40000000 + SZ_128M - MAX_FB_SIZE),
.fixed_screen_size = MAX_FB_SIZE,
};
static struct device_d ldcif_dev = {
@ -352,6 +359,12 @@ void base_board_init(void)
imx_set_sspclk(0, 100000000, 1);
register_device(&mci_socket);
if (imxfb_mode.fixed_screen < (void *)&_end) {
printf("Warning: fixed_screen overlaps barebox\n");
imxfb_mode.fixed_screen = NULL;
}
register_device(&ldcif_dev);
imx_enable_enetclk();

View File

@ -21,6 +21,7 @@
#include <asm/io.h>
#include <generated/mach-types.h>
#include <mach/imx-regs.h>
#include <asm/mmu.h>
static struct memory_platform_data ram_pdata = {
.name = "ram0",
@ -82,6 +83,28 @@ static const uint32_t tx28_pad_setup[] = {
extern void base_board_init(void);
#ifdef CONFIG_MMU
static int tx28_mmu_init(void)
{
mmu_init();
arm_create_section(0x40000000, 0x40000000, 128, PMD_SECT_DEF_CACHED);
arm_create_section(0x50000000, 0x40000000, 128, PMD_SECT_DEF_UNCACHED);
setup_dma_coherent(0x10000000);
#if TEXT_BASE & (0x100000 - 1)
#warning cannot create vector section. Adjust TEXT_BASE to a 1M boundary
#else
arm_create_section(0x0, TEXT_BASE, 1, PMD_SECT_DEF_UNCACHED);
#endif
mmu_enable();
return 0;
}
postcore_initcall(tx28_mmu_init);
#endif
static int tx28_devices_init(void)
{
int i;

View File

@ -66,6 +66,13 @@ struct imx_nand_platform_data nand_info = {
};
#ifdef CONFIG_USB
static struct device_d usbotg_dev = {
.id = -1,
.name = "ehci",
.map_base = IMX_OTG_BASE,
.size = 0x200,
};
static struct device_d usbh2_dev = {
.id = -1,
.name = "ehci",
@ -73,27 +80,19 @@ static struct device_d usbh2_dev = {
.size = 0x200,
};
static void pca100_usbh_init(void)
static void pca100_usb_register(void)
{
uint32_t temp;
temp = readl(IMX_OTG_BASE + 0x600);
temp &= ~((3 << 21) | 1);
temp |= (1 << 5) | (1 << 16) | (1 << 19) | (1 << 11) | (1 << 20);
writel(temp, IMX_OTG_BASE + 0x600);
temp = readl(IMX_OTG_BASE + 0x584);
temp &= ~(3 << 30);
temp |= 2 << 30;
writel(temp, IMX_OTG_BASE + 0x584);
mdelay(10);
gpio_direction_output(GPIO_PORTB + 24, 0);
gpio_direction_output(GPIO_PORTB + 23, 0);
mdelay(10);
isp1504_set_vbus_power((void *)(IMX_OTG_BASE + 0x170), 1);
register_device(&usbotg_dev);
isp1504_set_vbus_power((void *)(IMX_OTG_BASE + 0x570), 1);
register_device(&usbh2_dev);
}
#endif
@ -120,6 +119,38 @@ static void pca100_mmu_init(void)
}
#endif
static void pca100_usb_init(void)
{
u32 reg;
reg = readl(IMX_OTG_BASE + 0x600);
reg &= ~((3 << 21) | 1);
reg |= (1 << 5) | (1 << 16) | (1 << 19) | (1 << 11) | (1 << 20);
writel(reg, IMX_OTG_BASE + 0x600);
/*
* switch usbotg and usbh2 to ulpi mode. Do this *before*
* the iomux setup to prevent funny hardware bugs from
* triggering. Also, do this even when USB support is
* disabled to give Linux USB support a good start.
*/
reg = readl(IMX_OTG_BASE + 0x584);
reg &= ~(3 << 30);
reg |= 2 << 30;
writel(reg, IMX_OTG_BASE + 0x584);
reg = readl(IMX_OTG_BASE + 0x184);
reg &= ~(3 << 30);
reg |= 2 << 30;
writel(reg, IMX_OTG_BASE + 0x184);
/* disable the usb phys */
imx_gpio_mode((GPIO_PORTB | 23) | GPIO_GPIO | GPIO_IN);
gpio_direction_output(GPIO_PORTB + 23, 1);
imx_gpio_mode((GPIO_PORTB | 24) | GPIO_GPIO | GPIO_IN);
gpio_direction_output(GPIO_PORTB + 24, 1);
}
static int pca100_devices_init(void)
{
int i;
@ -175,15 +206,23 @@ static int pca100_devices_init(void)
PB7_PF_SD2_D3,
PB8_PF_SD2_CMD,
PB9_PF_SD2_CLK,
PC7_PF_USBOTG_DATA5,
PC8_PF_USBOTG_DATA6,
PC9_PF_USBOTG_DATA0,
PC10_PF_USBOTG_DATA2,
PC11_PF_USBOTG_DATA1,
PC12_PF_USBOTG_DATA4,
PC13_PF_USBOTG_DATA3,
PE0_PF_USBOTG_NXT,
PE1_PF_USBOTG_STP,
PE2_PF_USBOTG_DIR,
PE24_PF_USBOTG_CLK,
PE25_PF_USBOTG_DATA7,
};
PCCR0 |= PCCR0_SDHC2_EN;
/* disable the usb phys */
imx_gpio_mode((GPIO_PORTB | 23) | GPIO_GPIO | GPIO_IN);
gpio_direction_output(GPIO_PORTB + 23, 1);
imx_gpio_mode((GPIO_PORTB | 24) | GPIO_GPIO | GPIO_IN);
gpio_direction_output(GPIO_PORTB + 24, 1);
pca100_usb_init();
/* initizalize gpios */
for (i = 0; i < ARRAY_SIZE(mode); i++)
@ -197,8 +236,7 @@ static int pca100_devices_init(void)
PCCR1 |= PCCR1_PERCLK2_EN;
#ifdef CONFIG_USB
pca100_usbh_init();
register_device(&usbh2_dev);
pca100_usb_register();
#endif
nand = get_device_by_name("nand0");

View File

@ -1,3 +0,0 @@
echo running init

View File

@ -93,7 +93,7 @@ static int scb9328_devices_init(void) {
register_device(&sdram_dev);
register_device(&dm9000_dev);
devfs_add_partition("nor0", 0x00000, 0x20000, PARTITION_FIXED, "self0");
devfs_add_partition("nor0", 0x00000, 0x40000, PARTITION_FIXED, "self0");
devfs_add_partition("nor0", 0x40000, 0x20000, PARTITION_FIXED, "env0");
protect_file("/dev/env0", 1);

View File

@ -1,10 +1,15 @@
CONFIG_ARCH_STM=y
CONFIG_ARCH_MXS=y
CONFIG_MACH_CHUMBY=y
CONFIG_AEABI=y
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
CONFIG_MMU=y
CONFIG_MALLOC_SIZE=0x1000000
CONFIG_BROKEN=y
CONFIG_PROMPT="chumby:"
CONFIG_LONGHELP=y
CONFIG_GLOB=y
CONFIG_HUSH_FANCY_PROMPT=y
CONFIG_HUSH_GETOPT=y
CONFIG_CMDLINE_EDITING=y
CONFIG_AUTO_COMPLETE=y
CONFIG_PARTITION=y
@ -18,14 +23,28 @@ CONFIG_CMD_EXPORT=y
CONFIG_CMD_PRINTENV=y
CONFIG_CMD_READLINE=y
CONFIG_CMD_ECHO_E=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_MTEST=y
CONFIG_CMD_MTEST_ALTERNATIVE=y
CONFIG_CMD_RESET=y
CONFIG_CMD_GO=y
CONFIG_CMD_TIMEOUT=y
CONFIG_CMD_PARTITION=y
CONFIG_CMD_BMP=y
CONFIG_CMD_GPIO=y
CONFIG_NET=y
CONFIG_NET_DHCP=y
CONFIG_NET_NFS=y
CONFIG_NET_PING=y
CONFIG_NET_TFTP=y
CONFIG_NET_TFTP_PUSH=y
CONFIG_NET_NETCONSOLE=y
CONFIG_NET_RESOLV=y
CONFIG_NET_USB=y
CONFIG_NET_USB_ASIX=y
# CONFIG_SPI is not set
CONFIG_USB=y
CONFIG_USB_EHCI=y
CONFIG_VIDEO=y
CONFIG_DRIVER_VIDEO_STM=y
CONFIG_MCI=y

View File

@ -9,10 +9,10 @@ CONFIG_LONGHELP=y
CONFIG_GLOB=y
CONFIG_PROMPT_HUSH_PS2="cpuimx25>"
CONFIG_HUSH_FANCY_PROMPT=y
CONFIG_HUSH_GETOPT=y
CONFIG_CMDLINE_EDITING=y
CONFIG_AUTO_COMPLETE=y
CONFIG_PARTITION=y
CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/eukrea_cpuimx25/env"
CONFIG_CMD_EDIT=y
CONFIG_CMD_SLEEP=y
@ -22,9 +22,8 @@ CONFIG_CMD_EXPORT=y
CONFIG_CMD_PRINTENV=y
CONFIG_CMD_READLINE=y
CONFIG_CMD_ECHO_E=y
CONFIG_CMD_LOADB=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_CRC=y
CONFIG_CMD_CRC_CMP=y
CONFIG_CMD_MTEST=y
CONFIG_CMD_FLASH=y
CONFIG_CMD_BOOTM_ZLIB=y
@ -38,10 +37,14 @@ CONFIG_CMD_BMP=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_UNLZO=y
CONFIG_CMD_I2C=y
CONFIG_CMD_LED=y
CONFIG_CMD_LED_TRIGGER=y
CONFIG_NET=y
CONFIG_NET_DHCP=y
CONFIG_NET_NFS=y
CONFIG_NET_PING=y
CONFIG_NET_TFTP=y
CONFIG_NET_TFTP_PUSH=y
CONFIG_DRIVER_NET_FEC_IMX=y
# CONFIG_SPI is not set
CONFIG_I2C=y
@ -51,9 +54,11 @@ CONFIG_NAND=y
CONFIG_NAND_IMX=y
CONFIG_USB=y
CONFIG_USB_EHCI=y
CONFIG_USB_GADGET=y
CONFIG_VIDEO=y
CONFIG_DRIVER_VIDEO_IMX=y
CONFIG_MCI=y
CONFIG_MCI_IMX_ESDHC=y
CONFIG_MCI_IMX_ESDHC_PIO=y
CONFIG_LED=y
CONFIG_LED_GPIO=y
CONFIG_LED_TRIGGERS=y

View File

@ -1,4 +1,4 @@
CONFIG_ARCH_STM=y
CONFIG_ARCH_MXS=y
CONFIG_AEABI=y
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
CONFIG_BROKEN=y

View File

@ -23,7 +23,6 @@ CONFIG_CMD_PRINTENV=y
CONFIG_CMD_READLINE=y
CONFIG_CMD_ECHO_E=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_CRC=y
CONFIG_CMD_MTEST=y
CONFIG_CMD_FLASH=y
CONFIG_CMD_RESET=y
@ -31,6 +30,7 @@ CONFIG_CMD_GO=y
CONFIG_CMD_TIMEOUT=y
CONFIG_CMD_PARTITION=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_UNLZO=y
CONFIG_NET=y
CONFIG_NET_DHCP=y
CONFIG_NET_PING=y
@ -41,6 +41,11 @@ CONFIG_DRIVER_NET_FEC_IMX=y
CONFIG_NET_USB=y
CONFIG_NET_USB_ASIX=y
# CONFIG_SPI is not set
CONFIG_MTD=y
CONFIG_NAND=y
CONFIG_NAND_IMX=y
CONFIG_NAND_IMX_BOOT=y
CONFIG_UBI=y
CONFIG_USB=y
CONFIG_USB_EHCI=y
CONFIG_USB_ISP1504=y

View File

@ -1,11 +1,24 @@
CONFIG_ARCH_IMX=y
CONFIG_MACH_SCB9328=y
CONFIG_AEABI=y
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
CONFIG_LONGHELP=y
CONFIG_GLOB=y
CONFIG_HUSH_FANCY_PROMPT=y
CONFIG_CMDLINE_EDITING=y
CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/scb9328/env"
CONFIG_AUTO_COMPLETE=y
CONFIG_PARTITION=y
CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/scb9328/env/"
CONFIG_POLLER=y
CONFIG_CMD_EDIT=y
CONFIG_CMD_SLEEP=y
CONFIG_CMD_SAVEENV=y
CONFIG_CMD_LOADENV=y
CONFIG_CMD_EXPORT=y
CONFIG_CMD_PRINTENV=y
CONFIG_CMD_READLINE=y
CONFIG_CMD_ECHO_E=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_FLASH=y
CONFIG_CMD_RESET=y
@ -13,10 +26,23 @@ CONFIG_CMD_GO=y
CONFIG_CMD_TIMEOUT=y
CONFIG_CMD_PARTITION=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_UNLZO=y
CONFIG_CMD_LED=y
CONFIG_CMD_LED_TRIGGER=y
CONFIG_NET=y
CONFIG_NET_DHCP=y
CONFIG_NET_NFS=y
CONFIG_NET_PING=y
CONFIG_NET_TFTP=y
CONFIG_NET_TFTP_PUSH=y
CONFIG_NET_NETCONSOLE=y
CONFIG_NET_RESOLV=y
CONFIG_DRIVER_NET_DM9000=y
CONFIG_DRIVER_CFI=y
# CONFIG_DRIVER_CFI_BANK_WIDTH_4 is not set
CONFIG_CFI_BUFFER_WRITE=y
CONFIG_MTD=y
CONFIG_UBI=y
CONFIG_LED=y
CONFIG_LED_GPIO=y
CONFIG_LED_TRIGGERS=y

View File

@ -1,7 +1,8 @@
CONFIG_ARCH_STM=y
CONFIG_ARCH_MXS=y
CONFIG_ARCH_IMX28=y
CONFIG_AEABI=y
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
CONFIG_MMU=y
CONFIG_MALLOC_SIZE=0x800000
CONFIG_BROKEN=y
CONFIG_LONGHELP=y

View File

@ -73,6 +73,15 @@ config CPU_BIG_ENDIAN
port must properly enable any big-endian related features
of your chipset/board/processor.
config BOOT_ENDIANNESS_SWITCH
bool "Support switching of Linux kernel endianness"
help
Say Y here if you need to switch CPU endianness before running
Linux kernel, e.g. if you want big-endian Barebox to run
little-endian Linux.
Currently implemented only by "bootz" command.
config ARCH_HAS_L2X0
bool

View File

@ -95,13 +95,7 @@ void setup_dma_coherent(unsigned long offset)
void *dma_alloc_coherent(size_t size)
{
void *mem;
mem = memalign(4096, size);
if (mem)
return mem + dma_coherent_offset;
return NULL;
return xmemalign(4096, size) + dma_coherent_offset;
}
unsigned long virt_to_phys(void *virt)

View File

@ -25,6 +25,7 @@
#include <asm/barebox-arm.h>
#include <asm/system.h>
#include <asm-generic/memory_layout.h>
#include <asm/sections.h>
void __naked __section(.text_entry) exception_vectors(void)
{
@ -40,8 +41,6 @@ void __naked __section(.text_entry) exception_vectors(void)
);
}
extern char __bss_start, _end;
/*
* The actual reset vector. This code is position independent and usually
* does not run at the address it's linked at.
@ -108,7 +107,7 @@ void __naked __bare_init board_init_lowlevel_return(void)
(unsigned int)&__bss_start - TEXT_BASE);
/* clear bss */
memset(&__bss_start, 0, &_end - &__bss_start);
memset(__bss_start, 0, __bss_stop - __bss_start);
/* call start_barebox with its absolute address */
r = (unsigned int)&start_barebox;

View File

@ -28,7 +28,7 @@ void *phys_to_virt(unsigned long phys);
#else
static inline void *dma_alloc_coherent(size_t size)
{
return malloc(size);
return xmalloc(size);
}
static inline void dma_free_coherent(void *mem)

View File

@ -0,0 +1 @@
#include <asm-generic/sections.h>

View File

@ -0,0 +1,69 @@
/*
* arch/arm/include/asm/byteorder.h
*
* ARM Endian-ness. In little endian mode, the data bus is connected such
* that byte accesses appear as:
* 0 = d0...d7, 1 = d8...d15, 2 = d16...d23, 3 = d24...d31
* and word accesses (data or instruction) appear as:
* d0...d31
*
* When in big endian mode, byte accesses appear as:
* 0 = d24...d31, 1 = d16...d23, 2 = d8...d15, 3 = d0...d7
* and word accesses (data or instruction) appear as:
* d0...d31
*/
#ifndef __ASM_ARM_SWAB_H
#define __ASM_ARM_SWAB_H
#include <linux/compiler.h>
#include <linux/types.h>
#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
# define __SWAB_64_THRU_32__
#endif
#if defined(__KERNEL__) && __LINUX_ARM_ARCH__ >= 6
static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
{
__asm__ ("rev16 %0, %1" : "=r" (x) : "r" (x));
return x;
}
#define __arch_swab16 __arch_swab16
static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
{
__asm__ ("rev %0, %1" : "=r" (x) : "r" (x));
return x;
}
#define __arch_swab32 __arch_swab32
#else
static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
{
__u32 t;
#ifndef __thumb__
if (!__builtin_constant_p(x)) {
/*
* The compiler needs a bit of a hint here to always do the
* right thing and not screw it up to different degrees
* depending on the gcc version.
*/
asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
} else
#endif
t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */
x = (x << 24) | (x >> 8); /* mov r0,r0,ror #8 */
t &= ~0x00FF0000; /* bic r1,r1,#0x00FF0000 */
x ^= (t >> 8); /* eor r0,r0,r1,lsr #8 */
return x;
}
#define __arch_swab32 __arch_swab32
#endif
#endif

View File

@ -0,0 +1,130 @@
/*
* include/asm-arm/unified.h - Unified Assembler Syntax helper macros
*
* Copyright (C) 2008 ARM Limited
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ASM_UNIFIED_H
#define __ASM_UNIFIED_H
#if defined(__ASSEMBLY__) && defined(CONFIG_ARM_ASM_UNIFIED)
.syntax unified
#endif
#ifdef CONFIG_THUMB2_KERNEL
#if __GNUC__ < 4
#error Thumb-2 kernel requires gcc >= 4
#endif
/* The CPSR bit describing the instruction set (Thumb) */
#define PSR_ISETSTATE PSR_T_BIT
#define ARM(x...)
#define THUMB(x...) x
#ifdef __ASSEMBLY__
#define W(instr) instr.w
#endif
#define BSYM(sym) sym + 1
#else /* !CONFIG_THUMB2_KERNEL */
/* The CPSR bit describing the instruction set (ARM) */
#define PSR_ISETSTATE 0
#define ARM(x...) x
#define THUMB(x...)
#ifdef __ASSEMBLY__
#define W(instr) instr
#endif
#define BSYM(sym) sym
#endif /* CONFIG_THUMB2_KERNEL */
#ifndef CONFIG_ARM_ASM_UNIFIED
/*
* If the unified assembly syntax isn't used (in ARM mode), these
* macros expand to an empty string
*/
#ifdef __ASSEMBLY__
.macro it, cond
.endm
.macro itt, cond
.endm
.macro ite, cond
.endm
.macro ittt, cond
.endm
.macro itte, cond
.endm
.macro itet, cond
.endm
.macro itee, cond
.endm
.macro itttt, cond
.endm
.macro ittte, cond
.endm
.macro ittet, cond
.endm
.macro ittee, cond
.endm
.macro itett, cond
.endm
.macro itete, cond
.endm
.macro iteet, cond
.endm
.macro iteee, cond
.endm
#else /* !__ASSEMBLY__ */
__asm__(
" .macro it, cond\n"
" .endm\n"
" .macro itt, cond\n"
" .endm\n"
" .macro ite, cond\n"
" .endm\n"
" .macro ittt, cond\n"
" .endm\n"
" .macro itte, cond\n"
" .endm\n"
" .macro itet, cond\n"
" .endm\n"
" .macro itee, cond\n"
" .endm\n"
" .macro itttt, cond\n"
" .endm\n"
" .macro ittte, cond\n"
" .endm\n"
" .macro ittet, cond\n"
" .endm\n"
" .macro ittee, cond\n"
" .endm\n"
" .macro itett, cond\n"
" .endm\n"
" .macro itete, cond\n"
" .endm\n"
" .macro iteet, cond\n"
" .endm\n"
" .macro iteee, cond\n"
" .endm\n");
#endif /* __ASSEMBLY__ */
#endif /* CONFIG_ARM_ASM_UNIFIED */
#endif /* !__ASM_UNIFIED_H */

View File

@ -1,12 +1,5 @@
obj-y += armlinux.o
obj-y += _ashldi3.o
obj-y += _ashrdi3.o
obj-y += div0.o
obj-y += _divsi3.o
obj-y += _modsi3.o
obj-y += _udivsi3.o
obj-y += _umodsi3.o
obj-y += _lshrdi3.o
obj-y += findbit.o
obj-y += arm.o
obj-y += io-readsb.o
@ -15,8 +8,10 @@ obj-y += io-readsl.o
obj-y += io-writesb.o
obj-y += io-writesw-armv4.o
obj-y += io-writesl.o
obj-$(CONFIG_AEABI) += __aeabi_idivmod.o
obj-$(CONFIG_AEABI) += __aeabi_uidivmod.o
obj-y += lib1funcs.o
obj-y += ashrdi3.o
obj-y += ashldi3.o
obj-y += lshrdi3.o
obj-$(CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS) += memcpy.o
obj-$(CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS) += memset.o

View File

@ -1,50 +0,0 @@
/*
* linux/arch/arm/lib/lib1funcs.S: Optimized ARM division routines
*
* Author: Nicolas Pitre <nico@fluxnic.net>
* - contributed to gcc-3.4 on Sep 30, 2003
* - adapted for the Linux kernel on Oct 2, 2003
*/
/* Copyright 1995, 1996, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
In addition to the permissions in the GNU General Public License, the
Free Software Foundation gives you unlimited permission to link the
compiled version of this file into combinations with other programs,
and to distribute those combinations without any restriction coming
from the use of this file. (The General Public License restrictions
do apply in other respects; for example, they cover modification of
the file, and distribution when not linked into a combine
executable.)
This file 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
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <linux/linkage.h>
#include <asm/assembler.h>
.section .text.__aeabi_idivmod
ENTRY(__aeabi_idivmod)
stmfd sp!, {r0, r1, ip, lr}
bl __aeabi_idiv
ldmfd sp!, {r1, r2, ip, lr}
mul r3, r0, r2
sub r1, r1, r3
mov pc, lr
ENDPROC(__aeabi_idivmod)

View File

@ -1,51 +0,0 @@
/*
* linux/arch/arm/lib/lib1funcs.S: Optimized ARM division routines
*
* Author: Nicolas Pitre <nico@fluxnic.net>
* - contributed to gcc-3.4 on Sep 30, 2003
* - adapted for the Linux kernel on Oct 2, 2003
*/
/* Copyright 1995, 1996, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
In addition to the permissions in the GNU General Public License, the
Free Software Foundation gives you unlimited permission to link the
compiled version of this file into combinations with other programs,
and to distribute those combinations without any restriction coming
from the use of this file. (The General Public License restrictions
do apply in other respects; for example, they cover modification of
the file, and distribution when not linked into a combine
executable.)
This file 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
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <linux/linkage.h>
#include <asm/assembler.h>
.section .text.__aeabi_uidivmod
ENTRY(__aeabi_uidivmod)
stmfd sp!, {r0, r1, ip, lr}
bl __aeabi_uidiv
ldmfd sp!, {r1, r2, ip, lr}
mul r3, r0, r2
sub r1, r1, r3
mov pc, lr
ENDPROC(__aeabi_uidivmod)

View File

@ -1,144 +0,0 @@
.macro ARM_DIV_BODY dividend, divisor, result, curbit
#if __LINUX_ARM_ARCH__ >= 5
clz \curbit, \divisor
clz \result, \dividend
sub \result, \curbit, \result
mov \curbit, #1
mov \divisor, \divisor, lsl \result
mov \curbit, \curbit, lsl \result
mov \result, #0
#else
@ Initially shift the divisor left 3 bits if possible,
@ set curbit accordingly. This allows for curbit to be located
@ at the left end of each 4 bit nibbles in the division loop
@ to save one loop in most cases.
tst \divisor, #0xe0000000
moveq \divisor, \divisor, lsl #3
moveq \curbit, #8
movne \curbit, #1
@ Unless the divisor is very big, shift it up in multiples of
@ four bits, since this is the amount of unwinding in the main
@ division loop. Continue shifting until the divisor is
@ larger than the dividend.
1: cmp \divisor, #0x10000000
cmplo \divisor, \dividend
movlo \divisor, \divisor, lsl #4
movlo \curbit, \curbit, lsl #4
blo 1b
@ For very big divisors, we must shift it a bit at a time, or
@ we will be in danger of overflowing.
1: cmp \divisor, #0x80000000
cmplo \divisor, \dividend
movlo \divisor, \divisor, lsl #1
movlo \curbit, \curbit, lsl #1
blo 1b
mov \result, #0
#endif
@ Division loop
1: cmp \dividend, \divisor
subhs \dividend, \dividend, \divisor
orrhs \result, \result, \curbit
cmp \dividend, \divisor, lsr #1
subhs \dividend, \dividend, \divisor, lsr #1
orrhs \result, \result, \curbit, lsr #1
cmp \dividend, \divisor, lsr #2
subhs \dividend, \dividend, \divisor, lsr #2
orrhs \result, \result, \curbit, lsr #2
cmp \dividend, \divisor, lsr #3
subhs \dividend, \dividend, \divisor, lsr #3
orrhs \result, \result, \curbit, lsr #3
cmp \dividend, #0 @ Early termination?
movnes \curbit, \curbit, lsr #4 @ No, any more bits to do?
movne \divisor, \divisor, lsr #4
bne 1b
.endm
.macro ARM_DIV2_ORDER divisor, order
#if __LINUX_ARM_ARCH__ >= 5
clz \order, \divisor
rsb \order, \order, #31
#else
cmp \divisor, #(1 << 16)
movhs \divisor, \divisor, lsr #16
movhs \order, #16
movlo \order, #0
cmp \divisor, #(1 << 8)
movhs \divisor, \divisor, lsr #8
addhs \order, \order, #8
cmp \divisor, #(1 << 4)
movhs \divisor, \divisor, lsr #4
addhs \order, \order, #4
cmp \divisor, #(1 << 2)
addhi \order, \order, #3
addls \order, \order, \divisor, lsr #1
#endif
.endm
.section .text.__divsi3
.align 5
.globl __divsi3
__divsi3:
.globl __aeabi_idiv
__aeabi_idiv:
cmp r1, #0
eor ip, r0, r1 @ save the sign of the result.
beq Ldiv0
rsbmi r1, r1, #0 @ loops below use unsigned.
subs r2, r1, #1 @ division by 1 or -1 ?
beq 10f
movs r3, r0
rsbmi r3, r0, #0 @ positive dividend value
cmp r3, r1
bls 11f
tst r1, r2 @ divisor is power of 2 ?
beq 12f
ARM_DIV_BODY r3, r1, r0, r2
cmp ip, #0
rsbmi r0, r0, #0
mov pc, lr
10: teq ip, r0 @ same sign ?
rsbmi r0, r0, #0
mov pc, lr
11: movlo r0, #0
moveq r0, ip, asr #31
orreq r0, r0, #1
mov pc, lr
12: ARM_DIV2_ORDER r1, r2
cmp ip, #0
mov r0, r3, lsr r2
rsbmi r0, r0, #0
mov pc, lr
Ldiv0:
str lr, [sp, #-4]!
bl __div0
mov r0, #0 @ About as wrong as it could be.
ldr pc, [sp], #4

View File

@ -1,101 +0,0 @@
.section .text.__modsi3
.macro ARM_MOD_BODY dividend, divisor, order, spare
#if __LINUX_ARM_ARCH__ >= 5
clz \order, \divisor
clz \spare, \dividend
sub \order, \order, \spare
mov \divisor, \divisor, lsl \order
#else
mov \order, #0
@ Unless the divisor is very big, shift it up in multiples of
@ four bits, since this is the amount of unwinding in the main
@ division loop. Continue shifting until the divisor is
@ larger than the dividend.
1: cmp \divisor, #0x10000000
cmplo \divisor, \dividend
movlo \divisor, \divisor, lsl #4
addlo \order, \order, #4
blo 1b
@ For very big divisors, we must shift it a bit at a time, or
@ we will be in danger of overflowing.
1: cmp \divisor, #0x80000000
cmplo \divisor, \dividend
movlo \divisor, \divisor, lsl #1
addlo \order, \order, #1
blo 1b
#endif
@ Perform all needed substractions to keep only the reminder.
@ Do comparisons in batch of 4 first.
subs \order, \order, #3 @ yes, 3 is intended here
blt 2f
1: cmp \dividend, \divisor
subhs \dividend, \dividend, \divisor
cmp \dividend, \divisor, lsr #1
subhs \dividend, \dividend, \divisor, lsr #1
cmp \dividend, \divisor, lsr #2
subhs \dividend, \dividend, \divisor, lsr #2
cmp \dividend, \divisor, lsr #3
subhs \dividend, \dividend, \divisor, lsr #3
cmp \dividend, #1
mov \divisor, \divisor, lsr #4
subges \order, \order, #4
bge 1b
tst \order, #3
teqne \dividend, #0
beq 5f
@ Either 1, 2 or 3 comparison/substractions are left.
2: cmn \order, #2
blt 4f
beq 3f
cmp \dividend, \divisor
subhs \dividend, \dividend, \divisor
mov \divisor, \divisor, lsr #1
3: cmp \dividend, \divisor
subhs \dividend, \dividend, \divisor
mov \divisor, \divisor, lsr #1
4: cmp \dividend, \divisor
subhs \dividend, \dividend, \divisor
5:
.endm
.align 5
.globl __modsi3
__modsi3:
cmp r1, #0
beq Ldiv0
rsbmi r1, r1, #0 @ loops below use unsigned.
movs ip, r0 @ preserve sign of dividend
rsbmi r0, r0, #0 @ if negative make positive
subs r2, r1, #1 @ compare divisor with 1
cmpne r0, r1 @ compare dividend with divisor
moveq r0, #0
tsthi r1, r2 @ see if divisor is power of 2
andeq r0, r0, r2
bls 10f
ARM_MOD_BODY r0, r1, r2, r3
10: cmp ip, #0
rsbmi r0, r0, #0
mov pc, lr
Ldiv0:
str lr, [sp, #-4]!
bl __div0
mov r0, #0 @ About as wrong as it could be.
ldr pc, [sp], #4

View File

@ -1,81 +0,0 @@
/* # 1 "libgcc1.S" */
@ libgcc1 routines for ARM cpu.
@ Division routines, written by Richard Earnshaw, (rearnsha@armltd.co.uk)
dividend .req r0
divisor .req r1
result .req r2
curbit .req r3
/* ip .req r12 */
/* sp .req r13 */
/* lr .req r14 */
/* pc .req r15 */
.section .text.__udivsi3
.globl __udivsi3
.type __udivsi3 ,function
.globl __aeabi_uidiv
.type __aeabi_uidiv ,function
.align 0
__udivsi3 :
__aeabi_uidiv :
cmp divisor, #0
beq Ldiv0
mov curbit, #1
mov result, #0
cmp dividend, divisor
bcc Lgot_result
Loop1:
@ Unless the divisor is very big, shift it up in multiples of
@ four bits, since this is the amount of unwinding in the main
@ division loop. Continue shifting until the divisor is
@ larger than the dividend.
cmp divisor, #0x10000000
cmpcc divisor, dividend
movcc divisor, divisor, lsl #4
movcc curbit, curbit, lsl #4
bcc Loop1
Lbignum:
@ For very big divisors, we must shift it a bit at a time, or
@ we will be in danger of overflowing.
cmp divisor, #0x80000000
cmpcc divisor, dividend
movcc divisor, divisor, lsl #1
movcc curbit, curbit, lsl #1
bcc Lbignum
Loop3:
@ Test for possible subtractions, and note which bits
@ are done in the result. On the final pass, this may subtract
@ too much from the dividend, but the result will be ok, since the
@ "bit" will have been shifted out at the bottom.
cmp dividend, divisor
subcs dividend, dividend, divisor
orrcs result, result, curbit
cmp dividend, divisor, lsr #1
subcs dividend, dividend, divisor, lsr #1
orrcs result, result, curbit, lsr #1
cmp dividend, divisor, lsr #2
subcs dividend, dividend, divisor, lsr #2
orrcs result, result, curbit, lsr #2
cmp dividend, divisor, lsr #3
subcs dividend, dividend, divisor, lsr #3
orrcs result, result, curbit, lsr #3
cmp dividend, #0 @ Early termination?
movnes curbit, curbit, lsr #4 @ No, any more bits to do?
movne divisor, divisor, lsr #4
bne Loop3
Lgot_result:
mov r0, result
mov pc, lr
Ldiv0:
str lr, [sp, #-4]!
bl __div0 (PLT)
mov r0, #0 @ about as wrong as it could be
ldmia sp!, {pc}
.size __udivsi3 , . - __udivsi3
/* # 235 "libgcc1.S" */
/* # 320 "libgcc1.S" */
/* # 421 "libgcc1.S" */
/* # 433 "libgcc1.S" */
/* # 456 "libgcc1.S" */
/* # 500 "libgcc1.S" */
/* # 580 "libgcc1.S" */

View File

@ -1,89 +0,0 @@
/* # 1 "libgcc1.S" */
@ libgcc1 routines for ARM cpu.
@ Division routines, written by Richard Earnshaw, (rearnsha@armltd.co.uk)
/* # 145 "libgcc1.S" */
dividend .req r0
divisor .req r1
overdone .req r2
curbit .req r3
/* ip .req r12 */
/* sp .req r13 */
/* lr .req r14 */
/* pc .req r15 */
.section .text.__umodsi3
.globl __umodsi3
.type __umodsi3 ,function
.align 0
__umodsi3 :
cmp divisor, #0
beq Ldiv0
mov curbit, #1
cmp dividend, divisor
movcc pc, lr
Loop1:
@ Unless the divisor is very big, shift it up in multiples of
@ four bits, since this is the amount of unwinding in the main
@ division loop. Continue shifting until the divisor is
@ larger than the dividend.
cmp divisor, #0x10000000
cmpcc divisor, dividend
movcc divisor, divisor, lsl #4
movcc curbit, curbit, lsl #4
bcc Loop1
Lbignum:
@ For very big divisors, we must shift it a bit at a time, or
@ we will be in danger of overflowing.
cmp divisor, #0x80000000
cmpcc divisor, dividend
movcc divisor, divisor, lsl #1
movcc curbit, curbit, lsl #1
bcc Lbignum
Loop3:
@ Test for possible subtractions. On the final pass, this may
@ subtract too much from the dividend, so keep track of which
@ subtractions are done, we can fix them up afterwards...
mov overdone, #0
cmp dividend, divisor
subcs dividend, dividend, divisor
cmp dividend, divisor, lsr #1
subcs dividend, dividend, divisor, lsr #1
orrcs overdone, overdone, curbit, ror #1
cmp dividend, divisor, lsr #2
subcs dividend, dividend, divisor, lsr #2
orrcs overdone, overdone, curbit, ror #2
cmp dividend, divisor, lsr #3
subcs dividend, dividend, divisor, lsr #3
orrcs overdone, overdone, curbit, ror #3
mov ip, curbit
cmp dividend, #0 @ Early termination?
movnes curbit, curbit, lsr #4 @ No, any more bits to do?
movne divisor, divisor, lsr #4
bne Loop3
@ Any subtractions that we should not have done will be recorded in
@ the top three bits of "overdone". Exactly which were not needed
@ are governed by the position of the bit, stored in ip.
@ If we terminated early, because dividend became zero,
@ then none of the below will match, since the bit in ip will not be
@ in the bottom nibble.
ands overdone, overdone, #0xe0000000
moveq pc, lr @ No fixups needed
tst overdone, ip, ror #3
addne dividend, dividend, divisor, lsr #3
tst overdone, ip, ror #2
addne dividend, dividend, divisor, lsr #2
tst overdone, ip, ror #1
addne dividend, dividend, divisor, lsr #1
mov pc, lr
Ldiv0:
str lr, [sp, #-4]!
bl __div0 (PLT)
mov r0, #0 @ about as wrong as it could be
ldmia sp!, {pc}
.size __umodsi3 , . - __umodsi3
/* # 320 "libgcc1.S" */
/* # 421 "libgcc1.S" */
/* # 433 "libgcc1.S" */
/* # 456 "libgcc1.S" */
/* # 500 "libgcc1.S" */
/* # 580 "libgcc1.S" */

View File

@ -3,7 +3,6 @@
#include <mem_malloc.h>
#include <asm/barebox-arm.h>
#include <asm-generic/memory_layout.h>
#include <reloc.h>
static int arm_mem_malloc_init(void)
{

View File

@ -41,6 +41,7 @@
#include <asm/setup.h>
#include <asm/barebox-arm.h>
#include <asm/armlinux.h>
#include <asm/system.h>
static struct tag *params;
static int armlinux_architecture = 0;
@ -85,9 +86,10 @@ static void setup_memory_tags(void)
}
}
static void setup_commandline_tag(const char *commandline)
static void setup_commandline_tag(const char *commandline, int swap)
{
const char *p;
size_t words;
if (!commandline)
return;
@ -102,12 +104,20 @@ static void setup_commandline_tag(const char *commandline)
if (*p == '\0')
return;
words = (strlen(p) + 1 /* NUL */ + 3 /* round up */) >> 2;
params->hdr.tag = ATAG_CMDLINE;
params->hdr.size =
(sizeof (struct tag_header) + strlen(p) + 1 + 4) >> 2;
params->hdr.size = (sizeof(struct tag_header) >> 2) + words;
strcpy(params->u.cmdline.cmdline, p);
#ifdef CONFIG_BOOT_ENDIANNESS_SWITCH
if (swap) {
u32 *cmd = (u32 *)params->u.cmdline.cmdline;
while (words--)
cmd[words] = swab32(cmd[words]);
}
#endif
params = tag_next(params);
}
@ -156,13 +166,13 @@ static void setup_end_tag (void)
params->hdr.size = 0;
}
static void setup_tags(struct image_data *data)
static void setup_tags(struct image_data *data, int swap)
{
const char *commandline = getenv("bootargs");
setup_start_tag();
setup_memory_tags();
setup_commandline_tag(commandline);
setup_commandline_tag(commandline, swap);
if (data && data->initrd)
setup_initrd_tag (&data->initrd->header);
@ -231,7 +241,7 @@ static int do_bootm_linux(struct image_data *data)
debug("## Transferring control to Linux (at address 0x%p) ...\n",
theKernel);
setup_tags(data);
setup_tags(data, 0);
if (relocate_image(data->os, (void *)image_get_load(os_header)))
return -1;
@ -290,18 +300,21 @@ late_initcall(armlinux_register_image_handler);
#ifdef CONFIG_CMD_BOOTZ
struct zimage_header {
u32 unsused[9];
u32 unused[9];
u32 magic;
u32 start;
u32 end;
};
#define ZIMAGE_MAGIC 0x016F2818
static int do_bootz(struct command *cmdtp, int argc, char *argv[])
{
void (*theKernel)(int zero, int arch, void *params);
int fd, ret;
int fd, ret, swap = 0;
struct zimage_header header;
void *zimage;
u32 end;
if (argc != 2) {
barebox_cmd_usage(cmdtp);
@ -320,27 +333,53 @@ static int do_bootz(struct command *cmdtp, int argc, char *argv[])
goto err_out;
}
if (header.magic != 0x016f2818) {
switch (header.magic) {
#ifdef CONFIG_BOOT_ENDIANNESS_SWITCH
case swab32(ZIMAGE_MAGIC):
swap = 1;
/* fall through */
#endif
case ZIMAGE_MAGIC:
break;
default:
printf("invalid magic 0x%08x\n", header.magic);
goto err_out;
}
zimage = xmalloc(header.end);
end = header.end;
if (swap)
end = swab32(end);
zimage = xmalloc(end);
memcpy(zimage, &header, sizeof(header));
ret = read(fd, zimage + sizeof(header), header.end - sizeof(header));
if (ret < header.end - sizeof(header)) {
ret = read(fd, zimage + sizeof(header), end - sizeof(header));
if (ret < end - sizeof(header)) {
printf("could not read %s\n", argv[1]);
goto err_out1;
}
if (swap) {
void *ptr;
for (ptr = zimage; ptr < zimage + end; ptr += 4)
*(u32 *)ptr = swab32(*(u32 *)ptr);
}
theKernel = zimage;
printf("loaded zImage from %s with size %d\n", argv[1], header.end);
printf("loaded zImage from %s with size %d\n", argv[1], end);
setup_tags(NULL);
setup_tags(NULL, swap);
shutdown_barebox();
if (swap) {
u32 reg;
__asm__ __volatile__("mrc p15, 0, %0, c1, c0" : "=r" (reg));
reg ^= CR_B; /* swap big-endian flag */
__asm__ __volatile__("mcr p15, 0, %0, c1, c0" :: "r" (reg));
}
theKernel(0, armlinux_architecture, armlinux_bootparams);
return 0;
@ -382,7 +421,7 @@ static int do_bootu(struct command *cmdtp, int argc, char *argv[])
if (!theKernel)
theKernel = (void *)simple_strtoul(argv[1], NULL, 0);
setup_tags(NULL);
setup_tags(NULL, 0);
shutdown_barebox();
theKernel(0, armlinux_architecture, armlinux_bootparams);

View File

@ -26,6 +26,8 @@ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#include <linux/linkage.h>
#ifdef __ARMEB__
#define al r1
#define ah r0
@ -34,17 +36,18 @@ Boston, MA 02110-1301, USA. */
#define ah r1
#endif
.section .text.__ashldi3
.globl __ashldi3
__ashldi3:
.globl __aeabi_llsl
__aeabi_llsl:
ENTRY(__ashldi3)
ENTRY(__aeabi_llsl)
subs r3, r2, #32
rsb ip, r2, #32
movmi ah, ah, lsl r2
movpl ah, al, lsl r3
orrmi ah, ah, al, lsr ip
ARM( orrmi ah, ah, al, lsr ip )
THUMB( lsrmi r3, al, ip )
THUMB( orrmi ah, ah, r3 )
mov al, al, lsl r2
mov pc, lr
ENDPROC(__ashldi3)
ENDPROC(__aeabi_llsl)

View File

@ -26,6 +26,8 @@ the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#include <linux/linkage.h>
#ifdef __ARMEB__
#define al r1
#define ah r0
@ -34,17 +36,18 @@ Boston, MA 02110-1301, USA. */
#define ah r1
#endif
.section .text.__ashrdi3
.globl __ashrdi3
__ashrdi3:
.globl __aeabi_lasr
__aeabi_lasr:
ENTRY(__ashrdi3)
ENTRY(__aeabi_lasr)
subs r3, r2, #32
rsb ip, r2, #32
movmi al, al, lsr r2
movpl al, ah, asr r3
orrmi al, al, ah, lsl ip
ARM( orrmi al, al, ah, lsl ip )
THUMB( lslmi r3, ah, ip )
THUMB( orrmi al, al, r3 )
mov ah, ah, asr r2
mov pc, lr
ENDPROC(__ashrdi3)
ENDPROC(__aeabi_lasr)

View File

@ -75,5 +75,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss*) }
__bss_stop = .;
_end = .;
}

348
arch/arm/lib/lib1funcs.S Normal file
View File

@ -0,0 +1,348 @@
/*
* linux/arch/arm/lib/lib1funcs.S: Optimized ARM division routines
*
* Author: Nicolas Pitre <nico@fluxnic.net>
* - contributed to gcc-3.4 on Sep 30, 2003
* - adapted for the Linux kernel on Oct 2, 2003
*/
/* Copyright 1995, 1996, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
In addition to the permissions in the GNU General Public License, the
Free Software Foundation gives you unlimited permission to link the
compiled version of this file into combinations with other programs,
and to distribute those combinations without any restriction coming
from the use of this file. (The General Public License restrictions
do apply in other respects; for example, they cover modification of
the file, and distribution when not linked into a combine
executable.)
This file 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
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <linux/linkage.h>
#include <asm/assembler.h>
.macro ARM_DIV_BODY dividend, divisor, result, curbit
#if __LINUX_ARM_ARCH__ >= 5
clz \curbit, \divisor
clz \result, \dividend
sub \result, \curbit, \result
mov \curbit, #1
mov \divisor, \divisor, lsl \result
mov \curbit, \curbit, lsl \result
mov \result, #0
#else
@ Initially shift the divisor left 3 bits if possible,
@ set curbit accordingly. This allows for curbit to be located
@ at the left end of each 4 bit nibbles in the division loop
@ to save one loop in most cases.
tst \divisor, #0xe0000000
moveq \divisor, \divisor, lsl #3
moveq \curbit, #8
movne \curbit, #1
@ Unless the divisor is very big, shift it up in multiples of
@ four bits, since this is the amount of unwinding in the main
@ division loop. Continue shifting until the divisor is
@ larger than the dividend.
1: cmp \divisor, #0x10000000
cmplo \divisor, \dividend
movlo \divisor, \divisor, lsl #4
movlo \curbit, \curbit, lsl #4
blo 1b
@ For very big divisors, we must shift it a bit at a time, or
@ we will be in danger of overflowing.
1: cmp \divisor, #0x80000000
cmplo \divisor, \dividend
movlo \divisor, \divisor, lsl #1
movlo \curbit, \curbit, lsl #1
blo 1b
mov \result, #0
#endif
@ Division loop
1: cmp \dividend, \divisor
subhs \dividend, \dividend, \divisor
orrhs \result, \result, \curbit
cmp \dividend, \divisor, lsr #1
subhs \dividend, \dividend, \divisor, lsr #1
orrhs \result, \result, \curbit, lsr #1
cmp \dividend, \divisor, lsr #2
subhs \dividend, \dividend, \divisor, lsr #2
orrhs \result, \result, \curbit, lsr #2
cmp \dividend, \divisor, lsr #3
subhs \dividend, \dividend, \divisor, lsr #3
orrhs \result, \result, \curbit, lsr #3
cmp \dividend, #0 @ Early termination?
movnes \curbit, \curbit, lsr #4 @ No, any more bits to do?
movne \divisor, \divisor, lsr #4
bne 1b
.endm
.macro ARM_DIV2_ORDER divisor, order
#if __LINUX_ARM_ARCH__ >= 5
clz \order, \divisor
rsb \order, \order, #31
#else
cmp \divisor, #(1 << 16)
movhs \divisor, \divisor, lsr #16
movhs \order, #16
movlo \order, #0
cmp \divisor, #(1 << 8)
movhs \divisor, \divisor, lsr #8
addhs \order, \order, #8
cmp \divisor, #(1 << 4)
movhs \divisor, \divisor, lsr #4
addhs \order, \order, #4
cmp \divisor, #(1 << 2)
addhi \order, \order, #3
addls \order, \order, \divisor, lsr #1
#endif
.endm
.macro ARM_MOD_BODY dividend, divisor, order, spare
#if __LINUX_ARM_ARCH__ >= 5
clz \order, \divisor
clz \spare, \dividend
sub \order, \order, \spare
mov \divisor, \divisor, lsl \order
#else
mov \order, #0
@ Unless the divisor is very big, shift it up in multiples of
@ four bits, since this is the amount of unwinding in the main
@ division loop. Continue shifting until the divisor is
@ larger than the dividend.
1: cmp \divisor, #0x10000000
cmplo \divisor, \dividend
movlo \divisor, \divisor, lsl #4
addlo \order, \order, #4
blo 1b
@ For very big divisors, we must shift it a bit at a time, or
@ we will be in danger of overflowing.
1: cmp \divisor, #0x80000000
cmplo \divisor, \dividend
movlo \divisor, \divisor, lsl #1
addlo \order, \order, #1
blo 1b
#endif
@ Perform all needed substractions to keep only the reminder.
@ Do comparisons in batch of 4 first.
subs \order, \order, #3 @ yes, 3 is intended here
blt 2f
1: cmp \dividend, \divisor
subhs \dividend, \dividend, \divisor
cmp \dividend, \divisor, lsr #1
subhs \dividend, \dividend, \divisor, lsr #1
cmp \dividend, \divisor, lsr #2
subhs \dividend, \dividend, \divisor, lsr #2
cmp \dividend, \divisor, lsr #3
subhs \dividend, \dividend, \divisor, lsr #3
cmp \dividend, #1
mov \divisor, \divisor, lsr #4
subges \order, \order, #4
bge 1b
tst \order, #3
teqne \dividend, #0
beq 5f
@ Either 1, 2 or 3 comparison/substractions are left.
2: cmn \order, #2
blt 4f
beq 3f
cmp \dividend, \divisor
subhs \dividend, \dividend, \divisor
mov \divisor, \divisor, lsr #1
3: cmp \dividend, \divisor
subhs \dividend, \dividend, \divisor
mov \divisor, \divisor, lsr #1
4: cmp \dividend, \divisor
subhs \dividend, \dividend, \divisor
5:
.endm
ENTRY(__udivsi3)
ENTRY(__aeabi_uidiv)
subs r2, r1, #1
moveq pc, lr
bcc Ldiv0
cmp r0, r1
bls 11f
tst r1, r2
beq 12f
ARM_DIV_BODY r0, r1, r2, r3
mov r0, r2
mov pc, lr
11: moveq r0, #1
movne r0, #0
mov pc, lr
12: ARM_DIV2_ORDER r1, r2
mov r0, r0, lsr r2
mov pc, lr
ENDPROC(__udivsi3)
ENDPROC(__aeabi_uidiv)
ENTRY(__umodsi3)
subs r2, r1, #1 @ compare divisor with 1
bcc Ldiv0
cmpne r0, r1 @ compare dividend with divisor
moveq r0, #0
tsthi r1, r2 @ see if divisor is power of 2
andeq r0, r0, r2
movls pc, lr
ARM_MOD_BODY r0, r1, r2, r3
mov pc, lr
ENDPROC(__umodsi3)
ENTRY(__divsi3)
ENTRY(__aeabi_idiv)
cmp r1, #0
eor ip, r0, r1 @ save the sign of the result.
beq Ldiv0
rsbmi r1, r1, #0 @ loops below use unsigned.
subs r2, r1, #1 @ division by 1 or -1 ?
beq 10f
movs r3, r0
rsbmi r3, r0, #0 @ positive dividend value
cmp r3, r1
bls 11f
tst r1, r2 @ divisor is power of 2 ?
beq 12f
ARM_DIV_BODY r3, r1, r0, r2
cmp ip, #0
rsbmi r0, r0, #0
mov pc, lr
10: teq ip, r0 @ same sign ?
rsbmi r0, r0, #0
mov pc, lr
11: movlo r0, #0
moveq r0, ip, asr #31
orreq r0, r0, #1
mov pc, lr
12: ARM_DIV2_ORDER r1, r2
cmp ip, #0
mov r0, r3, lsr r2
rsbmi r0, r0, #0
mov pc, lr
ENDPROC(__divsi3)
ENDPROC(__aeabi_idiv)
ENTRY(__modsi3)
cmp r1, #0
beq Ldiv0
rsbmi r1, r1, #0 @ loops below use unsigned.
movs ip, r0 @ preserve sign of dividend
rsbmi r0, r0, #0 @ if negative make positive
subs r2, r1, #1 @ compare divisor with 1
cmpne r0, r1 @ compare dividend with divisor
moveq r0, #0
tsthi r1, r2 @ see if divisor is power of 2
andeq r0, r0, r2
bls 10f
ARM_MOD_BODY r0, r1, r2, r3
10: cmp ip, #0
rsbmi r0, r0, #0
mov pc, lr
ENDPROC(__modsi3)
#ifdef CONFIG_AEABI
ENTRY(__aeabi_uidivmod)
stmfd sp!, {r0, r1, ip, lr}
bl __aeabi_uidiv
ldmfd sp!, {r1, r2, ip, lr}
mul r3, r0, r2
sub r1, r1, r3
mov pc, lr
ENDPROC(__aeabi_uidivmod)
ENTRY(__aeabi_idivmod)
stmfd sp!, {r0, r1, ip, lr}
bl __aeabi_idiv
ldmfd sp!, {r1, r2, ip, lr}
mul r3, r0, r2
sub r1, r1, r3
mov pc, lr
ENDPROC(__aeabi_idivmod)
#endif
Ldiv0:
str lr, [sp, #-8]!
bl __div0
mov r0, #0 @ About as wrong as it could be.
ldr pc, [sp], #8

View File

@ -25,6 +25,9 @@ along with this program; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#include <linux/linkage.h>
#ifdef __ARMEB__
#define al r1
#define ah r0
@ -32,18 +35,19 @@ Boston, MA 02110-1301, USA. */
#define al r0
#define ah r1
#endif
.section .text.__lshrdi3
.globl __lshrdi3
__lshrdi3:
.globl __aeabi_llsr
__aeabi_llsr:
ENTRY(__lshrdi3)
ENTRY(__aeabi_llsr)
subs r3, r2, #32
rsb ip, r2, #32
movmi al, al, lsr r2
movpl al, ah, lsr r3
orrmi al, al, ah, lsl ip
ARM( orrmi al, al, ah, lsl ip )
THUMB( lslmi r3, ah, ip )
THUMB( orrmi al, al, r3 )
mov ah, ah, lsr r2
mov pc, lr
ENDPROC(__lshrdi3)
ENDPROC(__aeabi_llsr)

View File

@ -175,7 +175,8 @@ config MACH_AT91SAM9M10G45EK
bool "Atmel AT91SAM9M10G45-EK Evaluation Kit"
select HAVE_NAND_ATMEL_BUSWIDTH_16
help
Select this if you are using Atmel's AT91SAM9M10G45-EK Evaluation Kit.
Select this if you are using Atmel's AT91SAM9M10G45-EK Evaluation Kit
or AT91SAM9G45-EKES or AT91SAM9M10-EKES (for those 2 select the LG LCD)
<http://atmel.com/dyn/products/tools_card_v2.asp?tool_id=4735>
config MACH_PM9G45
@ -206,4 +207,20 @@ config AT91_HAVE_2MMC
with 2 SD/MMC Slots. This is the case for AT91SAM9G20-EK rev. C and
onwards.
choice
prompt "LCD type"
depends on MACH_AT91SAM9M10G45EK
config LCD_TRULY_TFT1N4633E
bool "truly TFT1N4633-E"
help
Found on AT91SAM9M10G45-EK
config LCD_LG_LB043WQ1
bool "LG philips LB043WQ1"
help
Found on AT91SAM9G45-EKES and AT91SAM9M10-EKES
endchoice
endif

View File

@ -11,3 +11,4 @@ obj-$(CONFIG_IMX_IIM) += iim.o
obj-$(CONFIG_NAND_IMX) += nand.o
obj-y += speed.o
obj-y += devices.o
obj-y += boot.o

95
arch/arm/mach-imx/boot.c Normal file
View File

@ -0,0 +1,95 @@
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <common.h>
#include <environment.h>
#include <init.h>
#include <asm/io.h>
#include <mach/imx-regs.h>
#if defined(CONFIG_ARCH_IMX25) || defined(CONFIG_ARCH_IMX35)
/*
* Saves the boot source media into the $barebox_loc enviroment variable
*
* This information is useful for barebox init scripts as we can then easily
* use a kernel image stored on the same media that we launch barebox with
* (for example).
*
* imx25 and imx35 can boot into barebox from several media such as
* nand, nor, mmc/sd cards, serial roms. "mmc" is used to represent several
* sources as its impossible to distinguish between them.
*
* Some sources such as serial roms can themselves have 3 different boot
* possibilities (i2c1, i2c2 etc). It is assumed that any board will
* only be using one of these at any one time.
*
* Note also that I suspect that the boot source pins are only sampled at
* power up.
*/
static int imx_boot_save_loc(void)
{
const char *bareboxloc = NULL;
uint32_t reg;
unsigned int ctrl, type;
/* [CTRL][TYPE] */
const char *const locations[4][4] = {
{ /* CTRL = WEIM */
"nor",
NULL,
"onenand",
NULL,
}, { /* CTRL == NAND */
"nand",
"nand",
"nand",
"nand",
}, { /* CTRL == ATA, (imx35 only) */
NULL,
NULL, /* might be p-ata */
NULL,
NULL,
}, { /* CTRL == expansion */
"mmc", /* note imx25 could also be: movinand, ce-ata */
NULL,
"i2c",
"spi",
}
};
reg = readl(IMX_CCM_BASE + CCM_RCSR);
ctrl = (reg >> CCM_RCSR_MEM_CTRL_SHIFT) & 0x3;
type = (reg >> CCM_RCSR_MEM_TYPE_SHIFT) & 0x3;
bareboxloc = locations[ctrl][type];
if (bareboxloc) {
setenv("barebox_loc", bareboxloc);
export("barebox_loc");
}
return 0;
}
/*
* This can only be called after env_push_context() has been called
* so it is a late_initcall.
*/
late_initcall(imx_boot_save_loc);
#endif

View File

@ -79,6 +79,9 @@
#define PDR0_AUTO_CON (1 << 0)
#define PDR0_PER_SEL (1 << 26)
#define CCM_RCSR_MEM_CTRL_SHIFT 30
#define CCM_RCSR_MEM_TYPE_SHIFT 28
/*
* Adresses and ranges of the external chip select lines
*/

View File

@ -79,6 +79,9 @@
#define CCM_CGR1_SDHC1_SHIFT 26
#define CCM_CGR2_USB_SHIFT 22
#define CCM_RCSR_MEM_CTRL_SHIFT 25
#define CCM_RCSR_MEM_TYPE_SHIFT 23
#define PDR0_AUTO_MUX_DIV(x) (((x) & 0x7) << 9)
#define PDR0_CCM_PER_AHB(x) (((x) & 0x7) << 12)
#define PDR0_CON_MUX_DIV(x) (((x) & 0xf) << 16)

View File

@ -1,4 +1,4 @@
if ARCH_STM
if ARCH_MXS
config ARCH_TEXT_BASE
hex
@ -11,7 +11,7 @@ config BOARDINFO
default "Chumby Falconwing" if MACH_CHUMBY
default "Karo TX28" if MACH_TX28
comment "SigmaTel/Freescale i.MX System-on-Chip"
comment "Freescale i.MX System-on-Chip"
choice
prompt "Freescale i.MX Processor"
@ -55,6 +55,7 @@ choice
config MACH_TX28
bool "KARO tx28"
select HAVE_MMU
help
Say Y here if you are using the KARO TX28 CPU module.

View File

@ -1,4 +1,4 @@
obj-y += imx.o iomux-imx.o reset-imx.o
obj-$(CONFIG_DRIVER_VIDEO_STM) += imx_lcd_clk.o
obj-$(CONFIG_ARCH_IMX23) += speed-imx23.o clocksource-imx23.o
obj-$(CONFIG_ARCH_IMX23) += speed-imx23.o clocksource-imx23.o usb.o
obj-$(CONFIG_ARCH_IMX28) += speed-imx28.o clocksource-imx28.o

View File

@ -120,7 +120,8 @@ unsigned imx_set_lcdifclk(unsigned nc)
best_frac, best_div, 480 * 18 / best_frac,
480000 * 18 / best_frac / best_div);
reg = readl(IMX_CCM_BASE + HW_CLKCTRL_FRAC) & ~MASK_PIXFRAC;
reg = readl(IMX_CCM_BASE + HW_CLKCTRL_FRAC);
reg &= ~SET_PIXFRAC(MASK_PIXFRAC);
reg |= SET_PIXFRAC(best_frac);
writel(reg, IMX_CCM_BASE + HW_CLKCTRL_FRAC);
writel(reg & ~CLKCTRL_FRAC_CLKGATEPIX, IMX_CCM_BASE + HW_CLKCTRL_FRAC);

View File

@ -31,12 +31,21 @@
/** swap RGB to BGR */
#define FB_SYNC_SWAP_RGB (1 << 31)
struct imx_fb_videomode {
#define USE_LCD_RESET 1
struct imx_fb_platformdata {
struct fb_videomode *mode_list;
unsigned mode_cnt;
unsigned dotclk_delay; /**< refer manual HW_LCDIF_VDCTRL4 register */
unsigned ld_intf_width; /**< refer STMLCDIF_* macros */
unsigned bits_per_pixel;
void *fixed_screen; /**< if != NULL use this as framebuffer memory */
unsigned fixed_screen_size; /**< framebuffer memory size for fixed_screen */
unsigned flags;
void (*enable)(int enable); /**< hook to enable backlight */
};
#endif /* __MACH_FB_H */

View File

@ -38,5 +38,9 @@
#define IMX_SSP1_BASE 0x80010000
#define IMX_FB_BASE 0x80030000
#define IMX_SSP2_BASE 0x80034000
#define IMX_POWER_BASE 0x80044000
#define IMX_USBPHY_BASE 0x8007c000
#define IMX_DIGCTL_BASE 0x8001c000
#define IMX_USB_BASE 0x80080000
#endif /* __ASM_ARCH_MX23_REGS_H */

View File

@ -0,0 +1,6 @@
#ifndef __MACH_USB_H
#define __MACH_USB_H
int imx_usb_phy_enable(void);
#endif /* __MACH_USB_H */

92
arch/arm/mach-mxs/usb.c Normal file
View File

@ -0,0 +1,92 @@
/*
* i.MX23/28 USBPHY setup
*
* Copyright 2011 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <common.h>
#include <asm/io.h>
#include <mach/imx-regs.h>
#define POWER_CTRL (IMX_POWER_BASE + 0x0)
#define POWER_CTRL_CLKGATE 0x40000000
#define POWER_STS (IMX_POWER_BASE + 0xc0)
#define POWER_STS_VBUSVALID 0x00000002
#define POWER_STS_BVALID 0x00000004
#define POWER_STS_AVALID 0x00000008
#define POWER_DEBUG (IMX_POWER_BASE + 0x110)
#define POWER_DEBUG_BVALIDPIOLOCK 0x00000002
#define POWER_DEBUG_AVALIDPIOLOCK 0x00000004
#define POWER_DEBUG_VBUSVALIDPIOLOCK 0x00000008
#define USBPHY_PWD (IMX_USBPHY_BASE + 0x0)
#define USBPHY_CTRL (IMX_USBPHY_BASE + 0x30)
#define USBPHY_CTRL_SFTRST 0x80000000
#define USBPHY_CTRL_CLKGATE 0x40000000
#define CLK_PLLCTRL0 (IMX_CCM_BASE + 0x0)
#define PLLCTRL0_EN_USB_CLKS 0x00040000
#define DIGCTRL_CTRL (IMX_DIGCTL_BASE + 0x0)
#define DIGCTL_CTRL_USB_CLKGATE 0x00000004
#define SET 0x4
#define CLR 0x8
int imx_usb_phy_enable(void)
{
u32 reg;
/*
* Set these bits so that we can force the OTG bits high
* so the ARC core operates properly
*/
writel(POWER_CTRL_CLKGATE, POWER_CTRL + CLR);
writel(POWER_DEBUG_VBUSVALIDPIOLOCK |
POWER_DEBUG_AVALIDPIOLOCK |
POWER_DEBUG_BVALIDPIOLOCK, POWER_DEBUG + SET);
reg = readl(POWER_STS);
reg |= POWER_STS_BVALID | POWER_STS_AVALID | POWER_STS_VBUSVALID;
writel(reg, POWER_STS);
/* Reset USBPHY module */
writel(USBPHY_CTRL_SFTRST, USBPHY_CTRL + SET);
udelay(10);
/* Remove CLKGATE and SFTRST */
writel(USBPHY_CTRL_CLKGATE | USBPHY_CTRL_SFTRST, USBPHY_CTRL + CLR);
/* Turn on the USB clocks */
writel(PLLCTRL0_EN_USB_CLKS, CLK_PLLCTRL0 + SET);
writel(DIGCTL_CTRL_USB_CLKGATE, DIGCTRL_CTRL + CLR);
/* Power up the PHY */
writel(0, USBPHY_PWD);
/*
* Set precharge bit to cure overshoot problems at the
* start of packets
*/
writel(1, USBPHY_CTRL + SET);
return 0;
}

View File

@ -82,6 +82,7 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
__bss_stop = .;
_end = .;
}

View File

@ -0,0 +1 @@
#include <asm-generic/bitsperlong.h>

View File

@ -0,0 +1 @@
#include <asm-generic/sections.h>

View File

@ -0,0 +1,50 @@
/*
* Copyright 2009 Analog Devices Inc.
*
* Licensed under the GPL-2 or later.
*/
#ifndef _BLACKFIN_SWAB_H
#define _BLACKFIN_SWAB_H
#include <linux/types.h>
#include <asm-generic/swab.h>
#ifdef __GNUC__
static __inline__ __attribute_const__ __u32 __arch_swahb32(__u32 xx)
{
__u32 tmp;
__asm__("%1 = %0 >> 8 (V);\n\t"
"%0 = %0 << 8 (V);\n\t"
"%0 = %0 | %1;\n\t"
: "+d"(xx), "=&d"(tmp));
return xx;
}
#define __arch_swahb32 __arch_swahb32
static __inline__ __attribute_const__ __u32 __arch_swahw32(__u32 xx)
{
__u32 rv;
__asm__("%0 = PACK(%1.L, %1.H);\n\t": "=d"(rv): "d"(xx));
return rv;
}
#define __arch_swahw32 __arch_swahw32
static __inline__ __attribute_const__ __u32 __arch_swab32(__u32 xx)
{
return __arch_swahb32(__arch_swahw32(xx));
}
#define __arch_swab32 __arch_swab32
static __inline__ __attribute_const__ __u16 __arch_swab16(__u16 xx)
{
__u32 xw = xx;
__asm__("%0 <<= 8;\n %0.L = %0.L + %0.H (NS);\n": "+d"(xw));
return (__u16)xw;
}
#define __arch_swab16 __arch_swab16
#endif /* __GNUC__ */
#endif /* _BLACKFIN_SWAB_H */

View File

@ -55,6 +55,8 @@ SECTIONS
.plt : { *(.plt) }
.text :
{
_text = .;
_stext = .;
arch/ppc/mach-mpc5xxx/start.o (.text)
*(.text*)
*(.got1*)
@ -134,6 +136,7 @@ SECTIONS
*(.bss*)
*(COMMON)
}
__bss_stop = .;
_end = . ;
PROVIDE (end = .);
}

View File

@ -1,79 +1,12 @@
#ifndef _PPC_BYTEORDER_H
#define _PPC_BYTEORDER_H
#ifndef _ASM_POWERPC_BYTEORDER_H
#define _ASM_POWERPC_BYTEORDER_H
#include <asm/types.h>
#ifdef __GNUC__
extern __inline__ unsigned ld_le16(const volatile unsigned short *addr)
{
unsigned val;
__asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr));
return val;
}
extern __inline__ void st_le16(volatile unsigned short *addr, const unsigned val)
{
__asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr));
}
extern __inline__ unsigned ld_le32(const volatile unsigned *addr)
{
unsigned val;
__asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr));
return val;
}
extern __inline__ void st_le32(volatile unsigned *addr, const unsigned val)
{
__asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr));
}
/* alas, egcs sounds like it has a bug in this code that doesn't use the
inline asm correctly, and can cause file corruption. Until I hear that
it's fixed, I can live without the extra speed. I hope. */
#if !(__GNUC__ >= 2 && __GNUC_MINOR__ >= 90)
static __inline__ __attribute__((const)) __u16 ___arch__swab16(__u16 value)
{
__u16 result;
__asm__("rlwimi %0,%1,8,16,23"
: "=r" (result)
: "r" (value), "0" (value >> 8));
return result;
}
static __inline__ __attribute__((const)) __u32 ___arch__swab32(__u32 value)
{
__u32 result;
__asm__("rlwimi %0,%1,24,16,23\n\t"
"rlwimi %0,%1,8,8,15\n\t"
"rlwimi %0,%1,24,0,7"
: "=r" (result)
: "r" (value), "0" (value >> 24));
return result;
}
#define __arch__swab32(x) ___arch__swab32(x)
#define __arch__swab16(x) ___arch__swab16(x)
#endif
/* The same, but returns converted value from the location pointer by addr. */
#define __arch__swab16p(addr) ld_le16(addr)
#define __arch__swab32p(addr) ld_le32(addr)
/* The same, but do the conversion in situ, ie. put the value back to addr. */
#define __arch__swab16s(addr) st_le16(addr,*addr)
#define __arch__swab32s(addr) st_le32(addr,*addr)
#endif /* __GNUC__ */
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
#define __BYTEORDER_HAS_U64__
#endif
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/byteorder/big_endian.h>
#endif /* _PPC_BYTEORDER_H */
#endif /* _ASM_POWERPC_BYTEORDER_H */

View File

@ -0,0 +1 @@
#include <asm-generic/sections.h>

View File

@ -0,0 +1,90 @@
#ifndef _ASM_POWERPC_SWAB_H
#define _ASM_POWERPC_SWAB_H
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/types.h>
#include <linux/compiler.h>
#ifdef __GNUC__
#ifndef __powerpc64__
#define __SWAB_64_THRU_32__
#endif /* __powerpc64__ */
#ifdef __KERNEL__
static __inline__ __u16 ld_le16(const volatile __u16 *addr)
{
__u16 val;
__asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr));
return val;
}
#define __arch_swab16p ld_le16
static __inline__ void st_le16(volatile __u16 *addr, const __u16 val)
{
__asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr));
}
static inline void __arch_swab16s(__u16 *addr)
{
st_le16(addr, *addr);
}
#define __arch_swab16s __arch_swab16s
static __inline__ __u32 ld_le32(const volatile __u32 *addr)
{
__u32 val;
__asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr));
return val;
}
#define __arch_swab32p ld_le32
static __inline__ void st_le32(volatile __u32 *addr, const __u32 val)
{
__asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr));
}
static inline void __arch_swab32s(__u32 *addr)
{
st_le32(addr, *addr);
}
#define __arch_swab32s __arch_swab32s
static inline __attribute_const__ __u16 __arch_swab16(__u16 value)
{
__u16 result;
__asm__("rlwimi %0,%1,8,16,23"
: "=r" (result)
: "r" (value), "0" (value >> 8));
return result;
}
#define __arch_swab16 __arch_swab16
static inline __attribute_const__ __u32 __arch_swab32(__u32 value)
{
__u32 result;
__asm__("rlwimi %0,%1,24,16,23\n\t"
"rlwimi %0,%1,8,8,15\n\t"
"rlwimi %0,%1,24,0,7"
: "=r" (result)
: "r" (value), "0" (value >> 24));
return result;
}
#define __arch_swab32 __arch_swab32
#endif /* __KERNEL__ */
#endif /* __GNUC__ */
#endif /* _ASM_POWERPC_SWAB_H */

View File

@ -0,0 +1 @@
#include <asm-generic/sections.h>

View File

View File

@ -8,8 +8,6 @@ int linux_read(int fd, void *buf, size_t count);
int linux_read_nonblock(int fd, void *buf, size_t count);
ssize_t linux_write(int fd, const void *buf, size_t count);
off_t linux_lseek(int fildes, off_t offset);
int linux_getc (void);
void linux_putc (const char c);
int linux_tstc(int fd);
int barebox_register_console(char *name_template, int stdinfd, int stdoutfd);

View File

@ -73,17 +73,6 @@ static void cookmode(void)
tcsetattr(0, TCSANOW, &term_orig);
}
void linux_putc(const char c)
{
fputc(c, stdout);
/* If \n, also do \r */
if (c == '\n')
linux_putc ('\r');
fflush(stdout);
}
int linux_tstc(int fd)
{
struct timeval tv = {
@ -117,15 +106,6 @@ int ctrlc(void)
return 0;
}
int linux_getc(void)
{
char ret;
read(0, &ret, 1);
return ret;
}
uint64_t linux_get_time(void)
{
struct timespec ts;

View File

@ -24,10 +24,7 @@
*/
#include <string.h>
/* These symbols are generated by the linker */
extern char __bss_start;
extern char __bss_end;
#include <asm/sections.h>
extern void start_barebox(void);
@ -39,6 +36,6 @@ extern void start_barebox(void);
void uboot_entry(void)
{
/* clear the BSS first */
memset(&__bss_start, 0x00, &__bss_end - &__bss_start);
memset(__bss_start, 0x00, __bss_stop - __bss_start);
start_barebox();
}

View File

@ -51,7 +51,7 @@ protected_mode_jump:
.code32
.extern uboot_entry
.extern __bss_end
.extern __bss_stop
.type in_pm32, @function
in_pm32:
@ -65,7 +65,7 @@ in_pm32:
* Our flat mode code uses its own stack area behind the bss. With this we
* are still able to return to real mode temporarely
*/
movl $__bss_end + 32768, %esp
movl $__bss_stop + 32768, %esp
# Set up TR to make Intel VT happy
ltr %di

View File

@ -0,0 +1 @@
#include <asm-generic/sections.h>

View File

@ -0,0 +1,61 @@
#ifndef _ASM_X86_SWAB_H
#define _ASM_X86_SWAB_H
#include <linux/types.h>
#include <linux/compiler.h>
static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
{
#ifdef __i386__
# ifdef CONFIG_X86_BSWAP
asm("bswap %0" : "=r" (val) : "0" (val));
# else
asm("xchgb %b0,%h0\n\t" /* swap lower bytes */
"rorl $16,%0\n\t" /* swap words */
"xchgb %b0,%h0" /* swap higher bytes */
: "=q" (val)
: "0" (val));
# endif
#else /* __i386__ */
asm("bswapl %0"
: "=r" (val)
: "0" (val));
#endif
return val;
}
#define __arch_swab32 __arch_swab32
static inline __attribute_const__ __u64 __arch_swab64(__u64 val)
{
#ifdef __i386__
union {
struct {
__u32 a;
__u32 b;
} s;
__u64 u;
} v;
v.u = val;
# ifdef CONFIG_X86_BSWAP
asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
: "=r" (v.s.a), "=r" (v.s.b)
: "0" (v.s.a), "1" (v.s.b));
# else
v.s.a = __arch_swab32(v.s.a);
v.s.b = __arch_swab32(v.s.b);
asm("xchgl %0,%1"
: "=r" (v.s.a), "=r" (v.s.b)
: "0" (v.s.a), "1" (v.s.b));
# endif
return v.u;
#else /* __i386__ */
asm("bswapq %0"
: "=r" (val)
: "0" (val));
return val;
#endif
}
#define __arch_swab64 __arch_swab64
#endif /* _ASM_X86_SWAB_H */

View File

@ -188,7 +188,7 @@ SECTIONS
__bss_start = .;
*(.bss*);
*( COMMON )
__bss_end = .;
__bss_stop = .;
_end = .;
} > barebox
}

View File

@ -25,6 +25,7 @@ static inline void set_pixel(struct fb_info *info, void *adr, int r, int g, int
*(u16 *)adr = px;
break;
case 32:
*(u32 *)adr = px;
break;
}
}

View File

@ -184,10 +184,8 @@ static struct line *line_realloc(int len, struct line *line)
{
int size = 32;
if (!line) {
if (!line)
line = xzalloc(sizeof(struct line));
line->data = malloc(32);
}
while (size < len)
size <<= 1;

View File

@ -81,7 +81,7 @@ int env_push_context(void)
return 0;
}
late_initcall(env_push_context);
device_initcall(env_push_context);
/**
* FIXME

View File

@ -40,6 +40,7 @@
#include <environment.h>
#include <reloc.h>
#include <asm-generic/memory_layout.h>
#include <asm/sections.h>
extern initcall_t __barebox_initcalls_start[], __barebox_early_initcalls_end[],
__barebox_initcalls_end[];
@ -50,8 +51,8 @@ static void display_meminfo(void)
ulong mend = mem_malloc_end();
ulong msize = mend - mstart + 1;
debug("barebox code : 0x%08lX -> 0x%08lX BSS: -> 0x%08lX\n",
_barebox_start, _bss_start, _bss_end);
debug("barebox code: 0x%p -> 0x%p\n", _stext, _etext);
debug("bss segment: 0x%p -> 0x%p\n", __bss_start, __bss_stop);
printf("Malloc space: 0x%08lx -> 0x%08lx (size %s)\n",
mstart, mend, size_human_readable(msize));
#ifdef CONFIG_ARM

View File

@ -1,6 +1,6 @@
#!/bin/sh
echo "usage: $0 -t <kernel|rootfs|barebox> -d <nor|nand> [-m tftp|xmodem] [-f imagename] -c"
echo "usage: update -t <kernel|rootfs|barebox|bareboxenv> -d <nor|nand> [-m tftp|xmodem] [-f imagename] -c"
echo "update tools."
echo ""
echo "options"
@ -10,3 +10,4 @@ echo "default mode is tftp"
echo "type update -t kernel -d <nor|nand> [-m tftp|xmodem] [-f imagename] to update kernel into flash"
echo "type update -t rootfs -d <nor|nand> [-m tftp|xmodem] [-f imagename] to update rootfs into flash"
echo "type update -t barebox -d <nor|nand> [-m tftp|xmodem] [-f imagename] to update barebox into flash"
echo "type update -t bareboxenv -d <nor|nand> [-m tftp|xmodem] [-f imagename] to update bareboxenv into flash"

View File

@ -34,7 +34,10 @@ else
fi
if [ x$rootfs_type = xubifs ]; then
bootargs="$bootargs root=ubi0:root ubi.mtd=$rootfs_mtdblock"
if [ -z $ubiroot ]; then
ubiroot="root"
fi
bootargs="$bootargs root=ubi0:$ubiroot ubi.mtd=$rootfs_mtdblock"
else
bootargs="$bootargs root=/dev/mtdblock$rootfs_mtdblock"
fi

View File

@ -4,15 +4,15 @@ PATH=/env/bin
export PATH
. /env/config
if [ -e /dev/nor0 ]; then
if [ -e /dev/nor0 -a -n "$nor_parts" ]; then
addpart /dev/nor0 $nor_parts
fi
if [ -e /dev/disk0 ]; then
if [ -e /dev/disk0 -a -n "$disk_parts" ]; then
addpart /dev/disk0 $disk_parts
fi
if [ -e /dev/nand0 ]; then
if [ -e /dev/nand0 -a -n "$nand_parts" ]; then
addpart /dev/nand0 $nand_parts
# Uh, oh, hush first expands wildcards and then starts executing
@ -28,9 +28,6 @@ echo
echo -n "Hit any key to stop autoboot: "
timeout -a $autoboot_timeout
if [ $? != 0 ]; then
echo
update -h
echo
exit
fi

View File

@ -1,12 +1,12 @@
#!/bin/sh
. /env/config
type=""
device_type=""
check=n
mode=tftp
. /env/config
while getopt "ht:d:f:m:c" Option
do
if [ ${Option} = t ]; then
@ -35,6 +35,11 @@ elif [ x${type} = xbarebox ]; then
if [ x${image} = x ]; then
image=barebox.bin
fi
elif [ x${type} = xbareboxenv ]; then
image=$bareboxenvimage
if [ x${image} = x ]; then
image=bareboxenv.bin
fi
else
. /env/bin/_update_help
exit 1

Some files were not shown because too many files have changed in this diff Show More