Merge branch 'for-next/omap'
This commit is contained in:
commit
eebe92e3ad
|
@ -27,9 +27,9 @@ static void setup_feature_core(void)
|
|||
features->hdr.tag = FTAG_CORE;
|
||||
features->hdr.size = feature_tag_size(feature_tag_core);
|
||||
|
||||
memset(&features->u.core, 0, sizeof(features->u.core));
|
||||
features->u.core.magic = FEATURE_LIST_MAGIC;
|
||||
features->u.core.list_revision = FEATURE_LIST_REV;
|
||||
features->u.core.flags = 0;
|
||||
|
||||
features = feature_tag_next(features);
|
||||
}
|
||||
|
@ -38,8 +38,7 @@ static void setup_feature_product_name(void)
|
|||
features->hdr.tag = FTAG_PRODUCT_NAME;
|
||||
features->hdr.size = feature_tag_size(feature_tag_product_name);
|
||||
|
||||
memset(features->u.product_name.name, 0,
|
||||
sizeof(features->u.product_name.name));
|
||||
memset(&features->u.product_name, 0, sizeof(features->u.product_name));
|
||||
sprintf(features->u.product_name.name, "A80S");
|
||||
features->u.product_name.id = 0x13A8;
|
||||
|
||||
|
@ -50,10 +49,8 @@ static void setup_feature_product_serial_number(void)
|
|||
features->hdr.tag = FTAG_PRODUCT_SERIAL_NUMBER;
|
||||
features->hdr.size = feature_tag_size(feature_tag_product_serial);
|
||||
|
||||
features->u.product_serial.serial[0] = 0;
|
||||
features->u.product_serial.serial[1] = 0;
|
||||
features->u.product_serial.serial[2] = 0;
|
||||
features->u.product_serial.serial[3] = 0;
|
||||
memset(&features->u.product_serial, 0,
|
||||
sizeof(features->u.product_serial));
|
||||
|
||||
features = feature_tag_next(features);
|
||||
}
|
||||
|
@ -62,14 +59,7 @@ static void setup_feature_product_mac_address(void)
|
|||
features->hdr.tag = FTAG_PRODUCT_MAC_ADDRESS;
|
||||
features->hdr.size = feature_tag_size(feature_tag_product_mac_address);
|
||||
|
||||
features->u.mac_address.addr[0] = 0;
|
||||
features->u.mac_address.addr[1] = 0;
|
||||
features->u.mac_address.addr[2] = 0;
|
||||
features->u.mac_address.addr[3] = 0;
|
||||
features->u.mac_address.addr[4] = 0;
|
||||
features->u.mac_address.addr[5] = 0;
|
||||
features->u.mac_address.reserved1 = 0;
|
||||
features->u.mac_address.reserved2 = 0;
|
||||
memset(&features->u.mac_address, 0, sizeof(features->u.mac_address));
|
||||
|
||||
features = feature_tag_next(features);
|
||||
}
|
||||
|
@ -78,6 +68,8 @@ static void setup_feature_board_pcb_revision(void)
|
|||
features->hdr.tag = FTAG_BOARD_PCB_REVISION;
|
||||
features->hdr.size = feature_tag_size(feature_tag_board_revision);
|
||||
|
||||
memset(&features->u.board_revision, 0,
|
||||
sizeof(features->u.board_revision));
|
||||
features->u.board_revision.revision = 5;
|
||||
|
||||
features = feature_tag_next(features);
|
||||
|
@ -87,23 +79,10 @@ static void setup_feature_sdram(void)
|
|||
features->hdr.tag = FTAG_SDRAM;
|
||||
features->hdr.size = feature_tag_size(feature_tag_sdram);
|
||||
|
||||
memset(features->u.sdram.vendor, 0, sizeof(features->u.sdram.vendor));
|
||||
memset(features->u.sdram.product, 0,
|
||||
sizeof(features->u.sdram.product));
|
||||
memset(&features->u.sdram, 0, sizeof(features->u.sdram));
|
||||
sprintf(features->u.sdram.vendor , "elpida");
|
||||
sprintf(features->u.sdram.product, "EDB8064B1PB"/*"EDB4064B2PB"*/);
|
||||
features->u.sdram.type = 0;
|
||||
features->u.sdram.revision = 0;
|
||||
features->u.sdram.flags = 0;
|
||||
features->u.sdram.clock = 400;
|
||||
features->u.sdram.param_0 = 0;
|
||||
features->u.sdram.param_1 = 0;
|
||||
features->u.sdram.param_2 = 0;
|
||||
features->u.sdram.param_3 = 0;
|
||||
features->u.sdram.param_4 = 0;
|
||||
features->u.sdram.param_5 = 0;
|
||||
features->u.sdram.param_6 = 0;
|
||||
features->u.sdram.param_7 = 0;
|
||||
sprintf(features->u.sdram.product, "EDB8064B1PB");
|
||||
features->u.sdram.clock = 400;
|
||||
|
||||
features = feature_tag_next(features);
|
||||
}
|
||||
|
@ -112,6 +91,7 @@ static void setup_feature_pmic(void)
|
|||
features->hdr.tag = FTAG_PMIC;
|
||||
features->hdr.size = feature_tag_size(feature_tag_pmic);
|
||||
|
||||
memset(&features->u.pmic, 0, sizeof(features->u.pmic));
|
||||
features->u.pmic.flags = FTAG_PMIC_TPS62361;
|
||||
|
||||
features = feature_tag_next(features);
|
||||
|
@ -121,6 +101,7 @@ static void setup_feature_serial_port(void)
|
|||
features->hdr.tag = FTAG_SERIAL_PORT;
|
||||
features->hdr.size = feature_tag_size(feature_tag_serial_port);
|
||||
|
||||
memset(&features->u.serial_port, 0, sizeof(features->u.serial_port));
|
||||
features->u.serial_port.uart_id = 1;
|
||||
features->u.serial_port.speed = 115200;
|
||||
|
||||
|
@ -131,9 +112,10 @@ static void setup_feature_has_gpio_volume_keys(void)
|
|||
features->hdr.tag = FTAG_HAS_GPIO_VOLUME_KEYS;
|
||||
features->hdr.size = feature_tag_size(feature_tag_gpio_volume_keys);
|
||||
|
||||
memset(&features->u.gpio_volume_keys, 0,
|
||||
sizeof(features->u.gpio_volume_keys));
|
||||
features->u.gpio_volume_keys.gpio_vol_up = 0x2B;
|
||||
features->u.gpio_volume_keys.gpio_vol_down = 0x2C;
|
||||
features->u.gpio_volume_keys.flags = 0;
|
||||
|
||||
features = feature_tag_next(features);
|
||||
}
|
||||
|
@ -142,18 +124,9 @@ static void setup_feature_screen(void)
|
|||
features->hdr.tag = FTAG_SCREEN;
|
||||
features->hdr.size = feature_tag_size(feature_tag_screen);
|
||||
|
||||
memset(features->u.screen.vendor, 0,
|
||||
sizeof(features->u.screen.vendor));
|
||||
memset(&features->u.screen, 0, sizeof(features->u.screen));
|
||||
sprintf(features->u.screen.vendor, "CMI");
|
||||
features->u.screen.type = 0;
|
||||
features->u.screen.revision = 0;
|
||||
features->u.screen.vcom = 0;
|
||||
features->u.screen.backlight = 0xC8;
|
||||
features->u.screen.reserved[0] = 0;
|
||||
features->u.screen.reserved[1] = 0;
|
||||
features->u.screen.reserved[2] = 0;
|
||||
features->u.screen.reserved[3] = 0;
|
||||
features->u.screen.reserved[4] = 0;
|
||||
|
||||
features = feature_tag_next(features);
|
||||
}
|
||||
|
@ -162,6 +135,7 @@ static void setup_feature_turbo(void)
|
|||
features->hdr.tag = FTAG_TURBO;
|
||||
features->hdr.size = feature_tag_size(feature_tag_turbo);
|
||||
|
||||
memset(&features->u.turbo, 0, sizeof(features->u.turbo));
|
||||
features->u.turbo.flag = 1;
|
||||
|
||||
features = feature_tag_next(features);
|
||||
|
|
|
@ -17,15 +17,21 @@
|
|||
#include <generated/mach-types.h>
|
||||
#include <mach/omap4-silicon.h>
|
||||
#include <mach/omap4-devices.h>
|
||||
#include <mach/omap4_rom_usb.h>
|
||||
#include <sizes.h>
|
||||
#include <i2c/i2c.h>
|
||||
#include <gpio.h>
|
||||
#include <gpio_keys.h>
|
||||
#include <twl6030_pwrbtn.h>
|
||||
#include <readkey.h>
|
||||
#include "archos_features.h"
|
||||
|
||||
static int archosg9_console_init(void){
|
||||
if (IS_ENABLED(CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT))
|
||||
if (IS_ENABLED(CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT) &&
|
||||
omap4_usbboot_ready()) {
|
||||
add_generic_device("serial_omap4_usbboot", DEVICE_ID_DYNAMIC
|
||||
, NULL, 0, 0, 0, NULL);
|
||||
}
|
||||
if (IS_ENABLED(CONFIG_DRIVER_SERIAL_NS16550)) {
|
||||
gpio_direction_output(41, 0); /* gps_disable */
|
||||
gpio_direction_output(34, 1); /* 1v8_pwron */
|
||||
|
@ -44,12 +50,30 @@ mem_initcall(archosg9_mem_init);
|
|||
static struct i2c_board_info i2c_devices[] = {
|
||||
{ I2C_BOARD_INFO("twl6030", 0x48), },
|
||||
};
|
||||
#if defined(CONFIG_KEYBOARD_TWL6030) && defined(CONFIG_KEYBOARD_GPIO)
|
||||
static struct twl6030_pwrbtn_platform_data pwrbtn_data = {
|
||||
.code = KEY_ENTER
|
||||
};
|
||||
static struct gpio_keys_button keys[] = {
|
||||
{ .code = KEY_UP , .gpio = 43, .active_low = 1 },
|
||||
{ .code = KEY_DOWN, .gpio = 44, .active_low = 1 },
|
||||
};
|
||||
static struct gpio_keys_platform_data gk_data = {
|
||||
.buttons = keys,
|
||||
.nbuttons = ARRAY_SIZE(keys),
|
||||
.fifo_size = ARRAY_SIZE(keys)*sizeof(int)
|
||||
};
|
||||
#endif
|
||||
|
||||
static int archosg9_devices_init(void){
|
||||
i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
|
||||
omap44xx_add_i2c1(NULL);
|
||||
omap44xx_add_mmc1(NULL);
|
||||
omap44xx_add_mmc2(NULL);
|
||||
#if defined(CONFIG_KEYBOARD_TWL6030) && defined(CONFIG_KEYBOARD_GPIO)
|
||||
add_generic_device_res("twl6030_pwrbtn", DEVICE_ID_DYNAMIC, 0, 0,
|
||||
&pwrbtn_data);
|
||||
add_gpio_keys_device(DEVICE_ID_DYNAMIC, &gk_data);
|
||||
#endif
|
||||
|
||||
armlinux_set_bootparams((void *)0x80000100);
|
||||
/*
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
|
||||
export PATH=/env/bin
|
||||
|
||||
global hostname=generic
|
||||
global user=none
|
||||
global boot.default=net
|
||||
global allow_color=true
|
||||
global linux.bootargs.base
|
||||
#linux.bootargs.dyn.* will be cleared at the beginning of boot
|
||||
global linux.bootargs.dyn.ip
|
||||
global linux.bootargs.dyn.root
|
||||
global editcmd=sedit
|
||||
|
||||
/env/config
|
||||
|
||||
timeout -s -a 0
|
||||
autoboot="$?"
|
||||
|
||||
for i in /env/init/*; do
|
||||
. $i
|
||||
done
|
||||
|
||||
if [ "$autoboot" = 0 ]; then
|
||||
boot
|
||||
fi
|
||||
|
||||
/env/menu/mainmenu
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ "$1" = menu ]; then
|
||||
boot-menu-add-entry "$0" "Android from SD card"
|
||||
exit
|
||||
fi
|
||||
|
||||
path=/mnt/sd
|
||||
global.bootm.image=${path}/android
|
||||
global.bootm.initrd=${path}/initramfs.cpio.lzo
|
||||
global.linux.bootargs.base="mem=512M init=/linuxrc debug omapdss.debug=0 omapfb.debug=0 mem=512M@0xa0000000"
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ "$1" = menu ]; then
|
||||
boot-menu-add-entry "$0" "Linux from SD card"
|
||||
exit
|
||||
fi
|
||||
|
||||
path=/mnt/sd
|
||||
global.bootm.image=${path}/zImage
|
||||
initrd=${path}/initrd
|
||||
|
||||
if [ -f ${initrd} ]; then
|
||||
global.bootm.initrd=${initrd}
|
||||
global.linux.bootargs.base="console=ttyO0,115200n8 root=/dev/ram0"
|
||||
else
|
||||
global.linux.bootargs.base="console=ttyO0,115200n8 rootwait root=/dev/mmcblk0p2"
|
||||
fi
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ "$1" = menu ]; then
|
||||
boot-menu-add-entry "$0" "Android over usb"
|
||||
exit
|
||||
fi
|
||||
|
||||
path=/mnt/usb
|
||||
global.bootm.image=${path}/android
|
||||
global.bootm.initrd=${path}/initramfs.cpio.lzo
|
||||
global.linux.bootargs.base="mem=512M init=/linuxrc debug omapdss.debug=0 omapfb.debug=0 mem=512M@0xa0000000"
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ "$1" = menu ]; then
|
||||
boot-menu-add-entry "$0" "Linux over usb"
|
||||
exit
|
||||
fi
|
||||
|
||||
path=/mnt/usb
|
||||
global.bootm.image=${path}/zImage
|
||||
initrd=${path}/initrd
|
||||
|
||||
if [ -f ${initrd} ]; then
|
||||
global.bootm.initrd=${initrd}
|
||||
global.linux.bootargs.base="console=ttyO0,115200n8 root=/dev/ram0"
|
||||
else
|
||||
global.linux.bootargs.base="console=ttyO0,115200n8"
|
||||
fi
|
|
@ -1,3 +0,0 @@
|
|||
global.bootm.image="${TARGET_ROOT}/boot/zImage"
|
||||
global.bootm.initrd="${TARGET_ROOT}/boot/initrd"
|
||||
global.linux.bootargs.base="console=ttyO0,115200n8 root=/dev/ram0"
|
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ "$1" = menu ]; then
|
||||
init-menu-add-entry "$0" "Automountpoints"
|
||||
exit
|
||||
fi
|
||||
|
||||
# automount tftp server based on $eth0.serverip
|
||||
|
||||
mkdir -p /mnt/tftp
|
||||
automount /mnt/tftp 'ifup eth0 && mount -t tftp $eth0.serverip /mnt/tftp'
|
||||
|
||||
# automount nfs server example
|
||||
|
||||
#nfshost=somehost
|
||||
#mkdir -p /mnt/${nfshost}
|
||||
#automount /mnt/$nfshost "ifup eth0 && mount -t nfs ${nfshost}:/tftpboot /mnt/${nfshost}"
|
||||
|
||||
# FAT on usb disk example
|
||||
|
||||
#mkdir -p /mnt/fat
|
||||
#automount -d /mnt/fat 'usb && [ -e /dev/disk0.0 ] && mount /dev/disk0.0 /mnt/fat'
|
||||
|
||||
mkdir -p /mnt/sd
|
||||
automount -d /mnt/sd 'mount /dev/disk0.0 /mnt/sd'
|
||||
|
||||
mkdir -p /mnt/usb
|
||||
automount -d /mnt/usb 'mount -t omap4_usbbootfs omap4_usbboot /mnt/usb'
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -f /mnt/sd/zImage ]; then
|
||||
global.boot.default=sd-card-linux
|
||||
elif [ -f /mnt/sd/android ]; then
|
||||
global.boot.default=sd-card-android
|
||||
elif [ -f /mnt/usb/zImage ]; then
|
||||
global.boot.default=usb-linux
|
||||
elif [ -f /mnt/usb/android ]; then
|
||||
global.boot.default=usb-android
|
||||
fi
|
|
@ -1,6 +0,0 @@
|
|||
TARGET_ROOT="/mnt/usb"
|
||||
mkdir ${TARGET_ROOT}
|
||||
mount -t omap4_usbbootfs omap4_usbboot ${TARGET_ROOT}
|
||||
. /env/config
|
||||
. ${TARGET_ROOT}/boot/config
|
||||
bootm
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/sh
|
||||
|
||||
savepath=$PATH
|
||||
export menupath=$PATH:/env/menu
|
||||
|
||||
. /env/data/ansi-colors
|
||||
|
||||
while true; do
|
||||
export PATH=${menupath}
|
||||
|
||||
echo $PATH
|
||||
|
||||
menu -a -m boot -d "${CYAN}Welcome to Barebox${NC}"
|
||||
|
||||
boot-entries-collect
|
||||
|
||||
menu -e -a -m boot -c "settings" -d "Settings"
|
||||
menu -e -a -m boot -c 'PATH=$savepath; echo "enter exit to return to menu"; sh' -d "${DARK_YELLOW}Shell${NC}"
|
||||
menu -e -a -m boot -c 'boot_order mmc2_1 && reset' -d "${RED}Reboot into internal flash${NC}"
|
||||
menu -e -a -m boot -c 'boot_order mmc1 && reset' -d "${RED}Reboot into SD card${NC}"
|
||||
menu -e -a -m boot -c 'boot_order usb_1 && reset' -d "${RED}Reboot over usb${NC}"
|
||||
|
||||
menu -s -m boot
|
||||
menu -r -m boot
|
||||
done
|
|
@ -62,7 +62,6 @@
|
|||
#include <i2c/i2c.h>
|
||||
#include <linux/err.h>
|
||||
#include <usb/ehci.h>
|
||||
#include <mach/xload.h>
|
||||
|
||||
#ifdef CONFIG_DRIVER_SERIAL_NS16550
|
||||
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
#include <console.h>
|
||||
#include <init.h>
|
||||
#include <driver.h>
|
||||
#include <fs.h>
|
||||
#include <linux/stat.h>
|
||||
#include <envfs.h>
|
||||
#include <sizes.h>
|
||||
#include <io.h>
|
||||
|
@ -45,7 +43,6 @@
|
|||
#include <linux/err.h>
|
||||
#include <linux/phy.h>
|
||||
#include <usb/ehci.h>
|
||||
#include <mach/xload.h>
|
||||
#include <mach/am33xx-devices.h>
|
||||
#include <mach/am33xx-mux.h>
|
||||
#include <mach/wdt.h>
|
||||
|
@ -95,7 +92,7 @@ static void beaglebone_eth_init(void)
|
|||
|
||||
writel(0, AM33XX_MAC_MII_SEL);
|
||||
|
||||
enable_mii1_pin_mux();
|
||||
am33xx_enable_mii1_pin_mux();
|
||||
|
||||
am33xx_add_cpsw(&cpsw_data);
|
||||
}
|
||||
|
@ -104,7 +101,7 @@ static int beaglebone_devices_init(void)
|
|||
{
|
||||
am33xx_add_mmc0(NULL);
|
||||
|
||||
enable_i2c0_pin_mux();
|
||||
am33xx_enable_i2c0_pin_mux();
|
||||
beaglebone_eth_init();
|
||||
|
||||
armlinux_set_bootparams((void *)0x80000100);
|
||||
|
@ -113,33 +110,3 @@ static int beaglebone_devices_init(void)
|
|||
return 0;
|
||||
}
|
||||
device_initcall(beaglebone_devices_init);
|
||||
|
||||
#ifdef CONFIG_DEFAULT_ENVIRONMENT
|
||||
static int beaglebone_env_init(void)
|
||||
{
|
||||
struct stat s;
|
||||
char *diskdev = "/dev/disk0.0";
|
||||
int ret;
|
||||
|
||||
ret = stat(diskdev, &s);
|
||||
if (ret) {
|
||||
printf("device %s not found. Using default environment\n", diskdev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
mkdir ("/boot", 0666);
|
||||
ret = mount(diskdev, "fat", "/boot");
|
||||
if (ret) {
|
||||
printf("failed to mount %s\n", diskdev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_OMAP_BUILD_IFT))
|
||||
default_environment_path = "/dev/defaultenv";
|
||||
else
|
||||
default_environment_path = "/boot/barebox.env";
|
||||
|
||||
return 0;
|
||||
}
|
||||
late_initcall(beaglebone_env_init);
|
||||
#endif
|
||||
|
|
|
@ -243,7 +243,7 @@ static int beaglebone_board_init(void)
|
|||
beaglebone_sram_init();
|
||||
|
||||
/* Enable pin mux */
|
||||
enable_uart0_pin_mux();
|
||||
am33xx_enable_uart0_pin_mux();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -62,9 +62,9 @@
|
|||
*/
|
||||
static int omap3evm_init_console(void)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_OMAP3EVM_UART1))
|
||||
if (IS_ENABLED(CONFIG_OMAP_UART1))
|
||||
omap3_add_uart1();
|
||||
if (IS_ENABLED(CONFIG_OMAP3EVM_UART3))
|
||||
if (IS_ENABLED(CONFIG_OMAP_UART3))
|
||||
omap3_add_uart3();
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -122,12 +122,12 @@ static void mux_config(void)
|
|||
/*
|
||||
* Serial Interface
|
||||
*/
|
||||
#if defined(CONFIG_OMAP3EVM_UART1)
|
||||
#if defined(CONFIG_OMAP_UART1)
|
||||
MUX_VAL(CP(UART1_TX), (IDIS | PTD | DIS | M0));
|
||||
MUX_VAL(CP(UART1_RTS), (IDIS | PTD | DIS | M0));
|
||||
MUX_VAL(CP(UART1_CTS), (IEN | PTU | DIS | M0));
|
||||
MUX_VAL(CP(UART1_RX), (IEN | PTD | DIS | M0));
|
||||
#elif defined(CONFIG_OMAP3EVM_UART3)
|
||||
#elif defined(CONFIG_OMAP_UART3)
|
||||
MUX_VAL(CP(UART3_CTS_RCTX), (IEN | PTD | EN | M0));
|
||||
MUX_VAL(CP(UART3_RTS_SD), (IDIS | PTD | DIS | M0));
|
||||
MUX_VAL(CP(UART3_RX_IRRX), (IEN | PTD | DIS | M0));
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
#include <common.h>
|
||||
#include <console.h>
|
||||
#include <init.h>
|
||||
#include <fs.h>
|
||||
#include <driver.h>
|
||||
#include <io.h>
|
||||
#include <ns16550.h>
|
||||
#include <asm/armlinux.h>
|
||||
#include <linux/stat.h>
|
||||
#include <generated/mach-types.h>
|
||||
#include <mach/omap4-silicon.h>
|
||||
#include <mach/omap4-devices.h>
|
||||
|
@ -20,7 +18,6 @@
|
|||
#include <asm/mmu.h>
|
||||
#include <mach/gpio.h>
|
||||
#include <envfs.h>
|
||||
#include <mach/xload.h>
|
||||
#include <i2c/i2c.h>
|
||||
#include <gpio.h>
|
||||
#include <led.h>
|
||||
|
@ -164,30 +161,3 @@ static int panda_devices_init(void)
|
|||
return 0;
|
||||
}
|
||||
device_initcall(panda_devices_init);
|
||||
|
||||
#ifdef CONFIG_DEFAULT_ENVIRONMENT
|
||||
static int panda_env_init(void)
|
||||
{
|
||||
struct stat s;
|
||||
char *diskdev = "/dev/disk0.0";
|
||||
int ret;
|
||||
|
||||
ret = stat(diskdev, &s);
|
||||
if (ret) {
|
||||
printf("no %s. using default env\n", diskdev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
mkdir ("/boot", 0666);
|
||||
ret = mount(diskdev, "fat", "/boot");
|
||||
if (ret) {
|
||||
printf("failed to mount %s\n", diskdev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
default_environment_path = "/boot/bareboxenv";
|
||||
|
||||
return 0;
|
||||
}
|
||||
late_initcall(panda_env_init);
|
||||
#endif
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#include <mach/gpio.h>
|
||||
#include <mach/gpmc.h>
|
||||
#include <mach/gpmc_nand.h>
|
||||
#include <mach/xload.h>
|
||||
#include <i2c/i2c.h>
|
||||
|
||||
static int pcm049_console_init(void)
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
lwl-y += lowlevel.o
|
||||
obj-y += board.o
|
||||
obj-y += board.o mux.o
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#include <mach/am33xx-mux.h>
|
||||
#include <mach/am33xx-silicon.h>
|
||||
|
||||
#include "mux.h"
|
||||
|
||||
/**
|
||||
* @brief UART serial port initialization
|
||||
* arch
|
||||
|
@ -52,7 +54,7 @@ mem_initcall(pcm051_mem_init);
|
|||
|
||||
static int pcm051_devices_init(void)
|
||||
{
|
||||
enable_mmc0_pin_mux();
|
||||
pcm051_enable_mmc0_pin_mux();
|
||||
|
||||
am33xx_add_mmc0(NULL);
|
||||
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#include <common.h>
|
||||
#include <config.h>
|
||||
#include <asm/io.h>
|
||||
#include <mach/am33xx-mux.h>
|
||||
|
||||
static const struct module_pin_mux mmc0_pin_mux[] = {
|
||||
{OFFSET(mmc0_dat3), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT3 */
|
||||
{OFFSET(mmc0_dat2), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT2 */
|
||||
{OFFSET(mmc0_dat1), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT1 */
|
||||
{OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT0 */
|
||||
{OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_CLK */
|
||||
{OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_CMD */
|
||||
{OFFSET(spi0_cs1), (MODE(5) | RXACTIVE | PULLUP_EN)}, /* MMC0_CD */
|
||||
{-1},
|
||||
};
|
||||
|
||||
void pcm051_enable_mmc0_pin_mux(void)
|
||||
{
|
||||
configure_module_pin_mux(mmc0_pin_mux);
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
extern void pcm051_enable_mmc0_pin_mux(void);
|
|
@ -54,7 +54,6 @@
|
|||
#include <mach/gpmc.h>
|
||||
#include <mach/gpmc_nand.h>
|
||||
#include <mach/omap_hsmmc.h>
|
||||
#include <mach/xload.h>
|
||||
#include <mach/sdrc.h>
|
||||
#include <mach/omap3-silicon.h>
|
||||
#include <mach/sys_info.h>
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include <mach/gpio.h>
|
||||
#include <mach/gpmc.h>
|
||||
#include <mach/gpmc_nand.h>
|
||||
#include <mach/xload.h>
|
||||
#include <mach/omap_hsmmc.h>
|
||||
#include <mach/omap4-devices.h>
|
||||
#include <i2c/i2c.h>
|
||||
|
|
|
@ -1,49 +1,58 @@
|
|||
CONFIG_MACH_ARCHOSG9=y
|
||||
CONFIG_ARCH_OMAP=y
|
||||
CONFIG_ARCH_OMAP4=y
|
||||
CONFIG_AEABI=y
|
||||
CONFIG_OMAP4_USBBOOT=y
|
||||
CONFIG_MACH_ARCHOSG9=y
|
||||
CONFIG_THUMB2_BAREBOX=y
|
||||
CONFIG_ARM_BOARD_APPEND_ATAG=y
|
||||
CONFIG_CMD_ARM_MMUINFO=y
|
||||
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
|
||||
CONFIG_ARM_UNWIND=y
|
||||
# CONFIG_MMU is not set
|
||||
CONFIG_OMAP4_USBBOOT=y
|
||||
CONFIG_TEXT_BASE=0xa0000000
|
||||
CONFIG_MALLOC_BASE=0x90000000
|
||||
CONFIG_MALLOC_SIZE=0x10000000
|
||||
CONFIG_TEXT_BASE=0x8f000000
|
||||
CONFIG_MALLOC_SIZE=0x2000000
|
||||
CONFIG_MALLOC_TLSF=y
|
||||
CONFIG_KALLSYMS=y
|
||||
CONFIG_ARM_BOARD_APPEND_ATAG=y
|
||||
CONFIG_PROMPT="barebox> "
|
||||
CONFIG_LONGHELP=y
|
||||
CONFIG_GLOB=y
|
||||
CONFIG_HUSH_FANCY_PROMPT=y
|
||||
CONFIG_CMDLINE_EDITING=y
|
||||
CONFIG_AUTO_COMPLETE=y
|
||||
# CONFIG_CONSOLE_ACTIVATE_FIRST is not set
|
||||
CONFIG_CONSOLE_ACTIVATE_ALL=y
|
||||
CONFIG_MENU=y
|
||||
# CONFIG_TIMESTAMP is not set
|
||||
CONFIG_CONSOLE_ACTIVATE_ALL=y
|
||||
CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
|
||||
CONFIG_DEFAULT_ENVIRONMENT_PATH="defaultenv-2 arch/arm/boards/archosg9/env"
|
||||
CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/archosg9/env"
|
||||
CONFIG_CMD_EDIT=y
|
||||
CONFIG_CMD_SLEEP=y
|
||||
CONFIG_CMD_MSLEEP=y
|
||||
CONFIG_CMD_SAVEENV=y
|
||||
CONFIG_CMD_EXPORT=y
|
||||
CONFIG_CMD_PRINTENV=y
|
||||
CONFIG_CMD_READLINE=y
|
||||
CONFIG_CMD_MENU=y
|
||||
CONFIG_CMD_MENU_MANAGEMENT=y
|
||||
CONFIG_CMD_TIME=y
|
||||
CONFIG_CMD_DIRNAME=y
|
||||
CONFIG_CMD_LN=y
|
||||
CONFIG_CMD_READLINK=y
|
||||
CONFIG_CMD_TFTP=y
|
||||
CONFIG_CMD_ECHO_E=y
|
||||
CONFIG_CMD_LOADB=y
|
||||
CONFIG_CMD_MEMINFO=y
|
||||
CONFIG_CMD_IOMEM=y
|
||||
CONFIG_CMD_FLASH=y
|
||||
CONFIG_CMD_CRC=y
|
||||
CONFIG_CMD_CRC_CMP=y
|
||||
CONFIG_CMD_MD5SUM=y
|
||||
CONFIG_CMD_SHA1SUM=y
|
||||
CONFIG_CMD_SHA224SUM=y
|
||||
CONFIG_CMD_SHA256SUM=y
|
||||
CONFIG_CMD_FLASH=y
|
||||
CONFIG_CMD_BOOTM_SHOW_TYPE=y
|
||||
CONFIG_CMD_BOOTM_VERBOSE=y
|
||||
CONFIG_CMD_BOOTM_INITRD=y
|
||||
CONFIG_CMD_BOOTM_OFTREE=y
|
||||
CONFIG_CMD_BOOTM_OFTREE_UIMAGE=y
|
||||
CONFIG_CMD_BOOTM_AIMAGE=y
|
||||
CONFIG_CMD_UIMAGE=y
|
||||
# CONFIG_CMD_BOOTU is not set
|
||||
CONFIG_CMD_RESET=y
|
||||
CONFIG_CMD_BOOT_ORDER=y
|
||||
CONFIG_CMD_GO=y
|
||||
CONFIG_CMD_TIMEOUT=y
|
||||
CONFIG_CMD_PARTITION=y
|
||||
|
@ -52,19 +61,38 @@ CONFIG_CMD_MAGICVAR_HELP=y
|
|||
CONFIG_CMD_GPIO=y
|
||||
CONFIG_CMD_UNCOMPRESS=y
|
||||
CONFIG_CMD_I2C=y
|
||||
CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT=y
|
||||
CONFIG_CMD_LED=y
|
||||
CONFIG_CMD_LED_TRIGGER=y
|
||||
CONFIG_CMD_MIITOOL=y
|
||||
CONFIG_NET=y
|
||||
CONFIG_NET_DHCP=y
|
||||
CONFIG_NET_PING=y
|
||||
CONFIG_NET_NETCONSOLE=y
|
||||
CONFIG_NET_RESOLV=y
|
||||
CONFIG_DRIVER_SERIAL_NS16550=y
|
||||
CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y
|
||||
CONFIG_BAUDRATE=115200
|
||||
CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT=y
|
||||
CONFIG_NET_USB=y
|
||||
CONFIG_NET_USB_SMSC95XX=y
|
||||
# CONFIG_SPI is not set
|
||||
CONFIG_I2C=y
|
||||
CONFIG_I2C_OMAP=y
|
||||
CONFIG_MFD_TWLCORE=y
|
||||
CONFIG_MFD_TWL6030=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_EHCI=y
|
||||
CONFIG_MCI=y
|
||||
CONFIG_MCI_STARTUP=y
|
||||
CONFIG_MCI_OMAP_HSMMC=y
|
||||
CONFIG_MFD_TWL6030=y
|
||||
CONFIG_LED=y
|
||||
CONFIG_LED_GPIO=y
|
||||
CONFIG_LED_TRIGGERS=y
|
||||
CONFIG_KEYBOARD_GPIO=y
|
||||
CONFIG_KEYBOARD_TWL6030=y
|
||||
CONFIG_FS_TFTP=y
|
||||
CONFIG_FS_OMAP4_USBBOOT=y
|
||||
CONFIG_FS_NFS=y
|
||||
CONFIG_FS_FAT=y
|
||||
CONFIG_FS_FAT_WRITE=y
|
||||
CONFIG_FS_FAT_LFN=y
|
||||
CONFIG_FS_OMAP4_USBBOOT=y
|
||||
CONFIG_ZLIB=y
|
||||
CONFIG_LZO_DECOMPRESS=y
|
||||
|
|
|
@ -1,24 +1,32 @@
|
|||
CONFIG_MACH_ARCHOSG9=y
|
||||
CONFIG_ARCH_OMAP=y
|
||||
CONFIG_BAREBOX_MAX_IMAGE_SIZE=0xC000
|
||||
CONFIG_ARCH_OMAP4=y
|
||||
# CONFIG_OMAP_GPMC is not set
|
||||
CONFIG_OMAP_BUILD_IFT=y
|
||||
CONFIG_BAREBOX_MAX_IMAGE_SIZE=0xC000
|
||||
CONFIG_AEABI=y
|
||||
CONFIG_OMAP4_USBBOOT=y
|
||||
CONFIG_MACH_ARCHOSG9=y
|
||||
CONFIG_THUMB2_BAREBOX=y
|
||||
# CONFIG_CMD_ARM_CPUINFO is not set
|
||||
# CONFIG_MMU is not set
|
||||
# CONFIG_BANNER is not set
|
||||
# CONFIG_MEMINFO is not set
|
||||
CONFIG_TEXT_BASE=0x40300000
|
||||
CONFIG_MEMORY_LAYOUT_FIXED=y
|
||||
CONFIG_STACK_BASE=0x8f000000
|
||||
CONFIG_MALLOC_BASE=0x84000000
|
||||
CONFIG_MALLOC_SIZE=0x2000000
|
||||
CONFIG_SHELL_NONE=y
|
||||
# CONFIG_ERRNO_MESSAGES is not set
|
||||
# CONFIG_TIMESTAMP is not set
|
||||
CONFIG_CONSOLE_SIMPLE=y
|
||||
# CONFIG_DEFAULT_ENVIRONMENT is not set
|
||||
CONFIG_DRIVER_SERIAL_NS16550=y
|
||||
CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y
|
||||
CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT=y
|
||||
# CONFIG_SPI is not set
|
||||
# CONFIG_DISK_WRITE is not set
|
||||
CONFIG_MCI=y
|
||||
CONFIG_MCI_STARTUP=y
|
||||
# CONFIG_MCI_WRITE is not set
|
||||
CONFIG_MCI_OMAP_HSMMC=y
|
||||
# CONFIG_FS_RAMFS is not set
|
||||
# CONFIG_FS_DEVFS is not set
|
||||
CONFIG_FS_OMAP4_USBBOOT=y
|
||||
CONFIG_FS_FAT=y
|
||||
|
|
|
@ -6,9 +6,6 @@ CONFIG_THUMB2_BAREBOX=y
|
|||
# CONFIG_CMD_ARM_CPUINFO is not set
|
||||
CONFIG_MMU=y
|
||||
CONFIG_TEXT_BASE=0x40300000
|
||||
CONFIG_MEMORY_LAYOUT_FIXED=y
|
||||
CONFIG_STACK_BASE=0x8f000000
|
||||
CONFIG_MALLOC_BASE=0x84000000
|
||||
CONFIG_MALLOC_SIZE=0x2000000
|
||||
CONFIG_PROMPT="barebox> "
|
||||
CONFIG_SHELL_NONE=y
|
||||
|
|
|
@ -187,20 +187,21 @@ config MACH_PCM051
|
|||
|
||||
endchoice
|
||||
|
||||
if MACH_OMAP3EVM
|
||||
if ARCH_OMAP
|
||||
|
||||
choice
|
||||
prompt "Select UART"
|
||||
default OMAP_UART3
|
||||
|
||||
config OMAP3EVM_UART1
|
||||
config OMAP_UART1
|
||||
bool "Use UART1"
|
||||
depends on MACH_OMAP3EVM
|
||||
depends on ARCH_OMAP
|
||||
help
|
||||
Say Y here if you would like to use UART1 as console.
|
||||
|
||||
config OMAP3EVM_UART3
|
||||
config OMAP_UART3
|
||||
bool "Use UART3"
|
||||
depends on MACH_OMAP3EVM
|
||||
depends on ARCH_OMAP
|
||||
help
|
||||
Say Y here if you would like to use UART3 as console.
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# GNU General Public License for more details.
|
||||
#
|
||||
#
|
||||
obj-$(CONFIG_ARCH_OMAP) += syslib.o omap_devices.o
|
||||
obj-$(CONFIG_ARCH_OMAP) += syslib.o omap_devices.o omap_generic.o
|
||||
pbl-$(CONFIG_ARCH_OMAP) += syslib.o
|
||||
obj-$(CONFIG_OMAP_CLOCK_SOURCE_S32K) += s32k_clksource.o
|
||||
obj-$(CONFIG_OMAP_CLOCK_SOURCE_DMTIMER0) += dmtimer0.o
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <mach/am33xx-silicon.h>
|
||||
#include <mach/am33xx-clock.h>
|
||||
#include <mach/sys_info.h>
|
||||
#include <mach/xload.h>
|
||||
#include <mach/generic.h>
|
||||
#include <mach/am33xx-generic.h>
|
||||
|
||||
void __noreturn reset_cpu(unsigned long addr)
|
||||
|
|
|
@ -15,242 +15,12 @@
|
|||
#include <common.h>
|
||||
#include <config.h>
|
||||
#include <asm/io.h>
|
||||
#include <mach/am33xx-mux.h>
|
||||
#include <mach/am33xx-silicon.h>
|
||||
|
||||
#define MUX_CFG(value, offset) \
|
||||
__raw_writel(value, (AM33XX_CTRL_BASE + offset));
|
||||
|
||||
/* PAD Control Fields */
|
||||
#define SLEWCTRL (0x1 << 6)
|
||||
#define RXACTIVE (0x1 << 5)
|
||||
#define PULLUP_EN (0x1 << 4) /* Pull UP Selection */
|
||||
#define PULLUDEN (0x0 << 3) /* Pull up enabled */
|
||||
#define PULLUDDIS (0x1 << 3) /* Pull up disabled */
|
||||
#define MODE(val) val
|
||||
|
||||
/*
|
||||
* PAD CONTROL OFFSETS
|
||||
* Field names corresponds to the pad signal name
|
||||
*/
|
||||
/* TODO replace with defines */
|
||||
struct pad_signals {
|
||||
int gpmc_ad0;
|
||||
int gpmc_ad1;
|
||||
int gpmc_ad2;
|
||||
int gpmc_ad3;
|
||||
int gpmc_ad4;
|
||||
int gpmc_ad5;
|
||||
int gpmc_ad6;
|
||||
int gpmc_ad7;
|
||||
int gpmc_ad8;
|
||||
int gpmc_ad9;
|
||||
int gpmc_ad10;
|
||||
int gpmc_ad11;
|
||||
int gpmc_ad12;
|
||||
int gpmc_ad13;
|
||||
int gpmc_ad14;
|
||||
int gpmc_ad15;
|
||||
int gpmc_a0;
|
||||
int gpmc_a1;
|
||||
int gpmc_a2;
|
||||
int gpmc_a3;
|
||||
int gpmc_a4;
|
||||
int gpmc_a5;
|
||||
int gpmc_a6;
|
||||
int gpmc_a7;
|
||||
int gpmc_a8;
|
||||
int gpmc_a9;
|
||||
int gpmc_a10;
|
||||
int gpmc_a11;
|
||||
int gpmc_wait0;
|
||||
int gpmc_wpn;
|
||||
int gpmc_be1n;
|
||||
int gpmc_csn0;
|
||||
int gpmc_csn1;
|
||||
int gpmc_csn2;
|
||||
int gpmc_csn3;
|
||||
int gpmc_clk;
|
||||
int gpmc_advn_ale;
|
||||
int gpmc_oen_ren;
|
||||
int gpmc_wen;
|
||||
int gpmc_be0n_cle;
|
||||
int lcd_data0;
|
||||
int lcd_data1;
|
||||
int lcd_data2;
|
||||
int lcd_data3;
|
||||
int lcd_data4;
|
||||
int lcd_data5;
|
||||
int lcd_data6;
|
||||
int lcd_data7;
|
||||
int lcd_data8;
|
||||
int lcd_data9;
|
||||
int lcd_data10;
|
||||
int lcd_data11;
|
||||
int lcd_data12;
|
||||
int lcd_data13;
|
||||
int lcd_data14;
|
||||
int lcd_data15;
|
||||
int lcd_vsync;
|
||||
int lcd_hsync;
|
||||
int lcd_pclk;
|
||||
int lcd_ac_bias_en;
|
||||
int mmc0_dat3;
|
||||
int mmc0_dat2;
|
||||
int mmc0_dat1;
|
||||
int mmc0_dat0;
|
||||
int mmc0_clk;
|
||||
int mmc0_cmd;
|
||||
int mii1_col;
|
||||
int mii1_crs;
|
||||
int mii1_rxerr;
|
||||
int mii1_txen;
|
||||
int mii1_rxdv;
|
||||
int mii1_txd3;
|
||||
int mii1_txd2;
|
||||
int mii1_txd1;
|
||||
int mii1_txd0;
|
||||
int mii1_txclk;
|
||||
int mii1_rxclk;
|
||||
int mii1_rxd3;
|
||||
int mii1_rxd2;
|
||||
int mii1_rxd1;
|
||||
int mii1_rxd0;
|
||||
int rmii1_refclk;
|
||||
int mdio_data;
|
||||
int mdio_clk;
|
||||
int spi0_sclk;
|
||||
int spi0_d0;
|
||||
int spi0_d1;
|
||||
int spi0_cs0;
|
||||
int spi0_cs1;
|
||||
int ecap0_in_pwm0_out;
|
||||
int uart0_ctsn;
|
||||
int uart0_rtsn;
|
||||
int uart0_rxd;
|
||||
int uart0_txd;
|
||||
int uart1_ctsn;
|
||||
int uart1_rtsn;
|
||||
int uart1_rxd;
|
||||
int uart1_txd;
|
||||
int i2c0_sda;
|
||||
int i2c0_scl;
|
||||
int mcasp0_aclkx;
|
||||
int mcasp0_fsx;
|
||||
int mcasp0_axr0;
|
||||
int mcasp0_ahclkr;
|
||||
int mcasp0_aclkr;
|
||||
int mcasp0_fsr;
|
||||
int mcasp0_axr1;
|
||||
int mcasp0_ahclkx;
|
||||
int xdma_event_intr0;
|
||||
int xdma_event_intr1;
|
||||
int nresetin_out;
|
||||
int porz;
|
||||
int nnmi;
|
||||
int osc0_in;
|
||||
int osc0_out;
|
||||
int rsvd1;
|
||||
int tms;
|
||||
int tdi;
|
||||
int tdo;
|
||||
int tck;
|
||||
int ntrst;
|
||||
int emu0;
|
||||
int emu1;
|
||||
int osc1_in;
|
||||
int osc1_out;
|
||||
int pmic_power_en;
|
||||
int rtc_porz;
|
||||
int rsvd2;
|
||||
int ext_wakeup;
|
||||
int enz_kaldo_1p8v;
|
||||
int usb0_dm;
|
||||
int usb0_dp;
|
||||
int usb0_ce;
|
||||
int usb0_id;
|
||||
int usb0_vbus;
|
||||
int usb0_drvvbus;
|
||||
int usb1_dm;
|
||||
int usb1_dp;
|
||||
int usb1_ce;
|
||||
int usb1_id;
|
||||
int usb1_vbus;
|
||||
int usb1_drvvbus;
|
||||
int ddr_resetn;
|
||||
int ddr_csn0;
|
||||
int ddr_cke;
|
||||
int ddr_ck;
|
||||
int ddr_nck;
|
||||
int ddr_casn;
|
||||
int ddr_rasn;
|
||||
int ddr_wen;
|
||||
int ddr_ba0;
|
||||
int ddr_ba1;
|
||||
int ddr_ba2;
|
||||
int ddr_a0;
|
||||
int ddr_a1;
|
||||
int ddr_a2;
|
||||
int ddr_a3;
|
||||
int ddr_a4;
|
||||
int ddr_a5;
|
||||
int ddr_a6;
|
||||
int ddr_a7;
|
||||
int ddr_a8;
|
||||
int ddr_a9;
|
||||
int ddr_a10;
|
||||
int ddr_a11;
|
||||
int ddr_a12;
|
||||
int ddr_a13;
|
||||
int ddr_a14;
|
||||
int ddr_a15;
|
||||
int ddr_odt;
|
||||
int ddr_d0;
|
||||
int ddr_d1;
|
||||
int ddr_d2;
|
||||
int ddr_d3;
|
||||
int ddr_d4;
|
||||
int ddr_d5;
|
||||
int ddr_d6;
|
||||
int ddr_d7;
|
||||
int ddr_d8;
|
||||
int ddr_d9;
|
||||
int ddr_d10;
|
||||
int ddr_d11;
|
||||
int ddr_d12;
|
||||
int ddr_d13;
|
||||
int ddr_d14;
|
||||
int ddr_d15;
|
||||
int ddr_dqm0;
|
||||
int ddr_dqm1;
|
||||
int ddr_dqs0;
|
||||
int ddr_dqsn0;
|
||||
int ddr_dqs1;
|
||||
int ddr_dqsn1;
|
||||
int ddr_vref;
|
||||
int ddr_vtp;
|
||||
int ddr_strben0;
|
||||
int ddr_strben1;
|
||||
int ain7;
|
||||
int ain6;
|
||||
int ain5;
|
||||
int ain4;
|
||||
int ain3;
|
||||
int ain2;
|
||||
int ain1;
|
||||
int ain0;
|
||||
int vrefp;
|
||||
int vrefn;
|
||||
};
|
||||
|
||||
struct module_pin_mux {
|
||||
short reg_offset;
|
||||
unsigned char val;
|
||||
};
|
||||
|
||||
#define PAD_CTRL_BASE 0x800
|
||||
#define OFFSET(x) (unsigned int) (&((struct pad_signals *) \
|
||||
(PAD_CTRL_BASE))->x)
|
||||
|
||||
static const __maybe_unused struct module_pin_mux uart0_pin_mux[] = {
|
||||
{OFFSET(uart0_rxd), (MODE(0) | PULLUP_EN | RXACTIVE)}, /* UART0_RXD */
|
||||
{OFFSET(uart0_txd), (MODE(0) | PULLUDEN)}, /* UART0_TXD */
|
||||
|
@ -469,7 +239,7 @@ static const __maybe_unused struct module_pin_mux spi1_pin_mux[] = {
|
|||
/*
|
||||
* Configure the pin mux for the module
|
||||
*/
|
||||
static void configure_module_pin_mux(const struct module_pin_mux *mod_pin_mux)
|
||||
void configure_module_pin_mux(const struct module_pin_mux *mod_pin_mux)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -480,32 +250,32 @@ static void configure_module_pin_mux(const struct module_pin_mux *mod_pin_mux)
|
|||
MUX_CFG(mod_pin_mux[i].val, mod_pin_mux[i].reg_offset);
|
||||
}
|
||||
|
||||
void enable_mii1_pin_mux(void)
|
||||
void am33xx_enable_mii1_pin_mux(void)
|
||||
{
|
||||
configure_module_pin_mux(mii1_pin_mux);
|
||||
}
|
||||
|
||||
void enable_i2c0_pin_mux(void)
|
||||
void am33xx_enable_i2c0_pin_mux(void)
|
||||
{
|
||||
configure_module_pin_mux(i2c0_pin_mux);
|
||||
}
|
||||
|
||||
void enable_i2c1_pin_mux(void)
|
||||
void am33xx_enable_i2c1_pin_mux(void)
|
||||
{
|
||||
configure_module_pin_mux(i2c1_pin_mux);
|
||||
}
|
||||
|
||||
void enable_i2c2_pin_mux(void)
|
||||
void am33xx_enable_i2c2_pin_mux(void)
|
||||
{
|
||||
configure_module_pin_mux(i2c2_pin_mux);
|
||||
}
|
||||
|
||||
void enable_uart0_pin_mux(void)
|
||||
void am33xx_enable_uart0_pin_mux(void)
|
||||
{
|
||||
configure_module_pin_mux(uart0_pin_mux);
|
||||
}
|
||||
|
||||
void enable_mmc0_pin_mux(void)
|
||||
void am33xx_enable_mmc0_pin_mux(void)
|
||||
{
|
||||
configure_module_pin_mux(mmc0_pin_mux);
|
||||
}
|
||||
|
|
|
@ -13,11 +13,245 @@
|
|||
#ifndef __AM33XX_MUX_H__
|
||||
#define __AM33XX_MUX_H__
|
||||
|
||||
extern void enable_mii1_pin_mux(void);
|
||||
extern void enable_i2c0_pin_mux(void);
|
||||
extern void enable_i2c1_pin_mux(void);
|
||||
extern void enable_i2c2_pin_mux(void);
|
||||
extern void enable_uart0_pin_mux(void);
|
||||
extern void enable_mmc0_pin_mux(void);
|
||||
/* PAD Control Fields */
|
||||
#define SLEWCTRL (0x1 << 6)
|
||||
#define RXACTIVE (0x1 << 5)
|
||||
#define PULLUP_EN (0x1 << 4) /* Pull UP Selection */
|
||||
#define PULLUDEN (0x0 << 3) /* Pull up enabled */
|
||||
#define PULLUDDIS (0x1 << 3) /* Pull up disabled */
|
||||
#define MODE(val) val
|
||||
|
||||
/*
|
||||
* PAD CONTROL OFFSETS
|
||||
* Field names corresponds to the pad signal name
|
||||
*/
|
||||
/* TODO replace with defines */
|
||||
struct pad_signals {
|
||||
int gpmc_ad0;
|
||||
int gpmc_ad1;
|
||||
int gpmc_ad2;
|
||||
int gpmc_ad3;
|
||||
int gpmc_ad4;
|
||||
int gpmc_ad5;
|
||||
int gpmc_ad6;
|
||||
int gpmc_ad7;
|
||||
int gpmc_ad8;
|
||||
int gpmc_ad9;
|
||||
int gpmc_ad10;
|
||||
int gpmc_ad11;
|
||||
int gpmc_ad12;
|
||||
int gpmc_ad13;
|
||||
int gpmc_ad14;
|
||||
int gpmc_ad15;
|
||||
int gpmc_a0;
|
||||
int gpmc_a1;
|
||||
int gpmc_a2;
|
||||
int gpmc_a3;
|
||||
int gpmc_a4;
|
||||
int gpmc_a5;
|
||||
int gpmc_a6;
|
||||
int gpmc_a7;
|
||||
int gpmc_a8;
|
||||
int gpmc_a9;
|
||||
int gpmc_a10;
|
||||
int gpmc_a11;
|
||||
int gpmc_wait0;
|
||||
int gpmc_wpn;
|
||||
int gpmc_be1n;
|
||||
int gpmc_csn0;
|
||||
int gpmc_csn1;
|
||||
int gpmc_csn2;
|
||||
int gpmc_csn3;
|
||||
int gpmc_clk;
|
||||
int gpmc_advn_ale;
|
||||
int gpmc_oen_ren;
|
||||
int gpmc_wen;
|
||||
int gpmc_be0n_cle;
|
||||
int lcd_data0;
|
||||
int lcd_data1;
|
||||
int lcd_data2;
|
||||
int lcd_data3;
|
||||
int lcd_data4;
|
||||
int lcd_data5;
|
||||
int lcd_data6;
|
||||
int lcd_data7;
|
||||
int lcd_data8;
|
||||
int lcd_data9;
|
||||
int lcd_data10;
|
||||
int lcd_data11;
|
||||
int lcd_data12;
|
||||
int lcd_data13;
|
||||
int lcd_data14;
|
||||
int lcd_data15;
|
||||
int lcd_vsync;
|
||||
int lcd_hsync;
|
||||
int lcd_pclk;
|
||||
int lcd_ac_bias_en;
|
||||
int mmc0_dat3;
|
||||
int mmc0_dat2;
|
||||
int mmc0_dat1;
|
||||
int mmc0_dat0;
|
||||
int mmc0_clk;
|
||||
int mmc0_cmd;
|
||||
int mii1_col;
|
||||
int mii1_crs;
|
||||
int mii1_rxerr;
|
||||
int mii1_txen;
|
||||
int mii1_rxdv;
|
||||
int mii1_txd3;
|
||||
int mii1_txd2;
|
||||
int mii1_txd1;
|
||||
int mii1_txd0;
|
||||
int mii1_txclk;
|
||||
int mii1_rxclk;
|
||||
int mii1_rxd3;
|
||||
int mii1_rxd2;
|
||||
int mii1_rxd1;
|
||||
int mii1_rxd0;
|
||||
int rmii1_refclk;
|
||||
int mdio_data;
|
||||
int mdio_clk;
|
||||
int spi0_sclk;
|
||||
int spi0_d0;
|
||||
int spi0_d1;
|
||||
int spi0_cs0;
|
||||
int spi0_cs1;
|
||||
int ecap0_in_pwm0_out;
|
||||
int uart0_ctsn;
|
||||
int uart0_rtsn;
|
||||
int uart0_rxd;
|
||||
int uart0_txd;
|
||||
int uart1_ctsn;
|
||||
int uart1_rtsn;
|
||||
int uart1_rxd;
|
||||
int uart1_txd;
|
||||
int i2c0_sda;
|
||||
int i2c0_scl;
|
||||
int mcasp0_aclkx;
|
||||
int mcasp0_fsx;
|
||||
int mcasp0_axr0;
|
||||
int mcasp0_ahclkr;
|
||||
int mcasp0_aclkr;
|
||||
int mcasp0_fsr;
|
||||
int mcasp0_axr1;
|
||||
int mcasp0_ahclkx;
|
||||
int xdma_event_intr0;
|
||||
int xdma_event_intr1;
|
||||
int nresetin_out;
|
||||
int porz;
|
||||
int nnmi;
|
||||
int osc0_in;
|
||||
int osc0_out;
|
||||
int rsvd1;
|
||||
int tms;
|
||||
int tdi;
|
||||
int tdo;
|
||||
int tck;
|
||||
int ntrst;
|
||||
int emu0;
|
||||
int emu1;
|
||||
int osc1_in;
|
||||
int osc1_out;
|
||||
int pmic_power_en;
|
||||
int rtc_porz;
|
||||
int rsvd2;
|
||||
int ext_wakeup;
|
||||
int enz_kaldo_1p8v;
|
||||
int usb0_dm;
|
||||
int usb0_dp;
|
||||
int usb0_ce;
|
||||
int usb0_id;
|
||||
int usb0_vbus;
|
||||
int usb0_drvvbus;
|
||||
int usb1_dm;
|
||||
int usb1_dp;
|
||||
int usb1_ce;
|
||||
int usb1_id;
|
||||
int usb1_vbus;
|
||||
int usb1_drvvbus;
|
||||
int ddr_resetn;
|
||||
int ddr_csn0;
|
||||
int ddr_cke;
|
||||
int ddr_ck;
|
||||
int ddr_nck;
|
||||
int ddr_casn;
|
||||
int ddr_rasn;
|
||||
int ddr_wen;
|
||||
int ddr_ba0;
|
||||
int ddr_ba1;
|
||||
int ddr_ba2;
|
||||
int ddr_a0;
|
||||
int ddr_a1;
|
||||
int ddr_a2;
|
||||
int ddr_a3;
|
||||
int ddr_a4;
|
||||
int ddr_a5;
|
||||
int ddr_a6;
|
||||
int ddr_a7;
|
||||
int ddr_a8;
|
||||
int ddr_a9;
|
||||
int ddr_a10;
|
||||
int ddr_a11;
|
||||
int ddr_a12;
|
||||
int ddr_a13;
|
||||
int ddr_a14;
|
||||
int ddr_a15;
|
||||
int ddr_odt;
|
||||
int ddr_d0;
|
||||
int ddr_d1;
|
||||
int ddr_d2;
|
||||
int ddr_d3;
|
||||
int ddr_d4;
|
||||
int ddr_d5;
|
||||
int ddr_d6;
|
||||
int ddr_d7;
|
||||
int ddr_d8;
|
||||
int ddr_d9;
|
||||
int ddr_d10;
|
||||
int ddr_d11;
|
||||
int ddr_d12;
|
||||
int ddr_d13;
|
||||
int ddr_d14;
|
||||
int ddr_d15;
|
||||
int ddr_dqm0;
|
||||
int ddr_dqm1;
|
||||
int ddr_dqs0;
|
||||
int ddr_dqsn0;
|
||||
int ddr_dqs1;
|
||||
int ddr_dqsn1;
|
||||
int ddr_vref;
|
||||
int ddr_vtp;
|
||||
int ddr_strben0;
|
||||
int ddr_strben1;
|
||||
int ain7;
|
||||
int ain6;
|
||||
int ain5;
|
||||
int ain4;
|
||||
int ain3;
|
||||
int ain2;
|
||||
int ain1;
|
||||
int ain0;
|
||||
int vrefp;
|
||||
int vrefn;
|
||||
};
|
||||
|
||||
struct module_pin_mux {
|
||||
short reg_offset;
|
||||
unsigned char val;
|
||||
};
|
||||
|
||||
#define PAD_CTRL_BASE 0x800
|
||||
#define OFFSET(x) (unsigned int) (&((struct pad_signals *) \
|
||||
(PAD_CTRL_BASE))->x)
|
||||
|
||||
extern void configure_module_pin_mux(const struct module_pin_mux *mod_pin_mux);
|
||||
|
||||
/* Standard mux settings */
|
||||
extern void am33xx_enable_mii1_pin_mux(void);
|
||||
extern void am33xx_enable_i2c0_pin_mux(void);
|
||||
extern void am33xx_enable_i2c1_pin_mux(void);
|
||||
extern void am33xx_enable_i2c2_pin_mux(void);
|
||||
extern void am33xx_enable_uart0_pin_mux(void);
|
||||
extern void am33xx_enable_mmc0_pin_mux(void);
|
||||
|
||||
#endif /*__AM33XX_MUX_H__ */
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#ifdef CONFIG_ARCH_OMAP3
|
||||
#include <mach/omap3-silicon.h>
|
||||
|
||||
#ifdef CONFIG_OMAP3EVM_UART1
|
||||
#ifdef CONFIG_OMAP_UART1
|
||||
#define UART_BASE OMAP3_UART1_BASE
|
||||
#else
|
||||
#define UART_BASE OMAP3_UART3_BASE
|
||||
|
@ -32,8 +32,12 @@
|
|||
|
||||
#ifdef CONFIG_ARCH_OMAP4
|
||||
#include <mach/omap4-silicon.h>
|
||||
#ifdef CONFIG_OMAP_UART1
|
||||
#define UART_BASE OMAP44XX_UART1_BASE
|
||||
#else
|
||||
#define UART_BASE OMAP44XX_UART3_BASE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_AM33XX
|
||||
#include <mach/am33xx-silicon.h>
|
||||
|
@ -41,9 +45,30 @@
|
|||
#endif
|
||||
|
||||
#define LSR_THRE 0x20 /* Xmit holding register empty */
|
||||
#define LCR_BKSE 0x80 /* Bank select enable */
|
||||
#define LSR (5 << 2)
|
||||
#define THR (0 << 2)
|
||||
#define DLL (0 << 2)
|
||||
#define IER (1 << 2)
|
||||
#define DLM (1 << 2)
|
||||
#define FCR (2 << 2)
|
||||
#define LCR (3 << 2)
|
||||
#define MCR (4 << 2)
|
||||
#define MDR (8 << 2)
|
||||
|
||||
static inline void INIT_LL(void)
|
||||
{
|
||||
writeb(0x00, UART_BASE + LCR);
|
||||
writeb(0x00, UART_BASE + IER);
|
||||
writeb(0x07, UART_BASE + MDR);
|
||||
writeb(LCR_BKSE, UART_BASE + LCR);
|
||||
writeb(26, UART_BASE + DLL); /* 115200 */
|
||||
writeb(0, UART_BASE + DLM);
|
||||
writeb(0x03, UART_BASE + LCR);
|
||||
writeb(0x03, UART_BASE + MCR);
|
||||
writeb(0x07, UART_BASE + FCR);
|
||||
writeb(0x00, UART_BASE + MDR);
|
||||
}
|
||||
static inline void PUTC_LL(char c)
|
||||
{
|
||||
/* Wait until there is space in the FIFO */
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#ifndef _MACH_GENERIC_H
|
||||
#define _MACH_GENERIC_H
|
||||
|
||||
/* I2C controller revisions */
|
||||
#define OMAP_I2C_REV_2 0x20
|
||||
|
@ -24,3 +26,18 @@
|
|||
#else
|
||||
#define cpu_is_omap4xxx() (0)
|
||||
#endif
|
||||
|
||||
enum omap_boot_src {
|
||||
OMAP_BOOTSRC_UNKNOWN,
|
||||
OMAP_BOOTSRC_MMC1,
|
||||
OMAP_BOOTSRC_NAND,
|
||||
OMAP_BOOTSRC_SPI1,
|
||||
OMAP_BOOTSRC_USB1,
|
||||
};
|
||||
|
||||
enum omap_boot_src omap_bootsrc(void);
|
||||
enum omap_boot_src am33xx_bootsrc(void);
|
||||
enum omap_boot_src omap3_bootsrc(void);
|
||||
enum omap_boot_src omap4_bootsrc(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -122,8 +122,11 @@ struct omap4_usbboot {
|
|||
struct per_handle dread;
|
||||
struct per_handle dwrite;
|
||||
struct per_driver *io;
|
||||
int ready;
|
||||
};
|
||||
|
||||
int omap4_usbboot_open(void);
|
||||
int omap4_usbboot_ready(void);
|
||||
void omap4_usbboot_close(void);
|
||||
|
||||
void omap4_usbboot_queue_read(void *data, unsigned len);
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
#ifndef _MACH_XLOAD_H
|
||||
#define _MACH_XLOAD_H
|
||||
|
||||
enum omap_boot_src {
|
||||
OMAP_BOOTSRC_UNKNOWN,
|
||||
OMAP_BOOTSRC_MMC1,
|
||||
OMAP_BOOTSRC_NAND,
|
||||
OMAP_BOOTSRC_SPI1,
|
||||
OMAP_BOOTSRC_USB1,
|
||||
};
|
||||
|
||||
enum omap_boot_src am33xx_bootsrc(void);
|
||||
enum omap_boot_src omap3_bootsrc(void);
|
||||
enum omap_boot_src omap4_bootsrc(void);
|
||||
|
||||
#endif /* _MACH_XLOAD_H */
|
|
@ -40,7 +40,7 @@
|
|||
#include <mach/wdt.h>
|
||||
#include <mach/sys_info.h>
|
||||
#include <mach/syslib.h>
|
||||
#include <mach/xload.h>
|
||||
#include <mach/generic.h>
|
||||
|
||||
/**
|
||||
* @brief Reset the CPU
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <mach/omap4-silicon.h>
|
||||
#include <mach/omap4-mux.h>
|
||||
#include <mach/syslib.h>
|
||||
#include <mach/xload.h>
|
||||
#include <mach/generic.h>
|
||||
#include <mach/gpmc.h>
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/omap4_rom_usb.h>
|
||||
|
|
|
@ -33,12 +33,12 @@
|
|||
#include <common.h>
|
||||
#include <mach/omap4-silicon.h>
|
||||
#include <mach/omap4_rom_usb.h>
|
||||
#include <mach/xload.h>
|
||||
#include <mach/generic.h>
|
||||
#include <init.h>
|
||||
|
||||
static struct omap4_usbboot omap4_usbboot_pdata;
|
||||
static struct omap4_usbboot omap4_usbboot_data;
|
||||
|
||||
static int omap4_usbboot_open(void)
|
||||
int omap4_usbboot_open(void)
|
||||
{
|
||||
int (*rom_get_per_driver)(struct per_driver **io, u32 device_type);
|
||||
int (*rom_get_per_device)(struct per_handle **rh);
|
||||
|
@ -60,94 +60,103 @@ static int omap4_usbboot_open(void)
|
|||
|
||||
if ((boot->device_type != DEVICE_USB) &&
|
||||
(boot->device_type != DEVICE_USBEXT))
|
||||
return -1;
|
||||
return 0;
|
||||
|
||||
memset(&omap4_usbboot_pdata, 0, sizeof(omap4_usbboot_pdata));
|
||||
n = rom_get_per_driver(&omap4_usbboot_pdata.io, boot->device_type);
|
||||
memset(&omap4_usbboot_data, 0, sizeof(omap4_usbboot_data));
|
||||
n = rom_get_per_driver(&omap4_usbboot_data.io, boot->device_type);
|
||||
if (n)
|
||||
return n;
|
||||
|
||||
omap4_usbboot_pdata.dread.status = -1;
|
||||
omap4_usbboot_pdata.dread.xfer_mode = boot->xfer_mode;
|
||||
omap4_usbboot_pdata.dread.options = boot->options;
|
||||
omap4_usbboot_pdata.dread.device_type = boot->device_type;
|
||||
omap4_usbboot_data.dread.status = -1;
|
||||
omap4_usbboot_data.dread.xfer_mode = boot->xfer_mode;
|
||||
omap4_usbboot_data.dread.options = boot->options;
|
||||
omap4_usbboot_data.dread.device_type = boot->device_type;
|
||||
|
||||
omap4_usbboot_pdata.dwrite.status = -1;
|
||||
omap4_usbboot_pdata.dwrite.xfer_mode = boot->xfer_mode;
|
||||
omap4_usbboot_pdata.dwrite.options = boot->options;
|
||||
omap4_usbboot_pdata.dwrite.device_type = boot->device_type;
|
||||
omap4_usbboot_data.dwrite.status = -1;
|
||||
omap4_usbboot_data.dwrite.xfer_mode = boot->xfer_mode;
|
||||
omap4_usbboot_data.dwrite.options = boot->options;
|
||||
omap4_usbboot_data.dwrite.device_type = boot->device_type;
|
||||
__asm__ __volatile__ ("cpsie i\n");
|
||||
omap4_usbboot_data.ready = 1;
|
||||
|
||||
omap4_usbboot_puts("USB communications initialized\n");
|
||||
return 0;
|
||||
}
|
||||
core_initcall(omap4_usbboot_open);
|
||||
|
||||
int omap4_usbboot_ready(void){
|
||||
return omap4_usbboot_data.ready;
|
||||
}
|
||||
|
||||
static void rom_read_callback(struct per_handle *rh)
|
||||
{
|
||||
omap4_usbboot_pdata.dread.status = rh->status;
|
||||
omap4_usbboot_data.dread.status = rh->status;
|
||||
return;
|
||||
}
|
||||
|
||||
void omap4_usbboot_queue_read(void *data, unsigned len)
|
||||
{
|
||||
int n;
|
||||
omap4_usbboot_pdata.dread.data = data;
|
||||
omap4_usbboot_pdata.dread.length = len;
|
||||
omap4_usbboot_pdata.dread.status = STATUS_WAITING;
|
||||
omap4_usbboot_pdata.dread.xfer_mode = 1;
|
||||
omap4_usbboot_pdata.dread.callback = rom_read_callback;
|
||||
n = omap4_usbboot_pdata.io->read(&omap4_usbboot_pdata.dread);
|
||||
omap4_usbboot_data.dread.data = data;
|
||||
omap4_usbboot_data.dread.length = len;
|
||||
omap4_usbboot_data.dread.status = STATUS_WAITING;
|
||||
omap4_usbboot_data.dread.xfer_mode = 1;
|
||||
omap4_usbboot_data.dread.callback = rom_read_callback;
|
||||
n = omap4_usbboot_data.io->read(&omap4_usbboot_data.dread);
|
||||
if (n)
|
||||
omap4_usbboot_pdata.dread.status = n;
|
||||
omap4_usbboot_data.dread.status = n;
|
||||
}
|
||||
|
||||
int omap4_usbboot_wait_read(void)
|
||||
{
|
||||
int ret;
|
||||
while (omap4_usbboot_pdata.dread.status == STATUS_WAITING)
|
||||
while (omap4_usbboot_data.dread.status == STATUS_WAITING)
|
||||
/* cpu_relax(); */
|
||||
barrier();
|
||||
ret = omap4_usbboot_pdata.dread.status;
|
||||
omap4_usbboot_pdata.dread.status = -1;
|
||||
ret = omap4_usbboot_data.dread.status;
|
||||
omap4_usbboot_data.dread.status = -1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int omap4_usbboot_is_read_waiting(void)
|
||||
{
|
||||
barrier();
|
||||
return omap4_usbboot_pdata.dread.status == STATUS_WAITING;
|
||||
return omap4_usbboot_data.dread.status == STATUS_WAITING;
|
||||
}
|
||||
|
||||
int omap4_usbboot_is_read_ok(void)
|
||||
{
|
||||
barrier();
|
||||
return omap4_usbboot_pdata.dread.status == STATUS_OKAY;
|
||||
return omap4_usbboot_data.dread.status == STATUS_OKAY;
|
||||
}
|
||||
|
||||
static void rom_write_callback(struct per_handle *rh)
|
||||
{
|
||||
omap4_usbboot_pdata.dwrite.status = rh->status;
|
||||
omap4_usbboot_data.dwrite.status = rh->status;
|
||||
return;
|
||||
}
|
||||
|
||||
void omap4_usbboot_queue_write(void *data, unsigned len)
|
||||
{
|
||||
int n;
|
||||
omap4_usbboot_pdata.dwrite.data = data;
|
||||
omap4_usbboot_pdata.dwrite.length = len;
|
||||
omap4_usbboot_pdata.dwrite.status = STATUS_WAITING;
|
||||
omap4_usbboot_pdata.dwrite.xfer_mode = 1;
|
||||
omap4_usbboot_pdata.dwrite.callback = rom_write_callback;
|
||||
n = omap4_usbboot_pdata.io->write(&omap4_usbboot_pdata.dwrite);
|
||||
omap4_usbboot_data.dwrite.data = data;
|
||||
omap4_usbboot_data.dwrite.length = len;
|
||||
omap4_usbboot_data.dwrite.status = STATUS_WAITING;
|
||||
omap4_usbboot_data.dwrite.xfer_mode = 1;
|
||||
omap4_usbboot_data.dwrite.callback = rom_write_callback;
|
||||
n = omap4_usbboot_data.io->write(&omap4_usbboot_data.dwrite);
|
||||
if (n)
|
||||
omap4_usbboot_pdata.dwrite.status = n;
|
||||
omap4_usbboot_data.dwrite.status = n;
|
||||
}
|
||||
|
||||
int omap4_usbboot_wait_write(void)
|
||||
{
|
||||
int ret;
|
||||
while (omap4_usbboot_pdata.dwrite.status == STATUS_WAITING)
|
||||
while (omap4_usbboot_data.dwrite.status == STATUS_WAITING)
|
||||
/* cpu_relax(); */
|
||||
barrier();
|
||||
ret = omap4_usbboot_pdata.dwrite.status;
|
||||
omap4_usbboot_pdata.dwrite.status = -1;
|
||||
ret = omap4_usbboot_data.dwrite.status;
|
||||
omap4_usbboot_data.dwrite.status = -1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -177,7 +186,7 @@ int omap4_usbboot_write(void *data, unsigned len)
|
|||
|
||||
void omap4_usbboot_close(void)
|
||||
{
|
||||
omap4_usbboot_pdata.io->close(&omap4_usbboot_pdata.dread);
|
||||
omap4_usbboot_data.io->close(&omap4_usbboot_data.dread);
|
||||
}
|
||||
|
||||
void omap4_usbboot_puts(const char *s)
|
||||
|
@ -186,13 +195,3 @@ void omap4_usbboot_puts(const char *s)
|
|||
while ((c = *s++))
|
||||
omap4_usbboot_write(&c, 4);
|
||||
}
|
||||
|
||||
static int omap4_usbboot_init(void)
|
||||
{
|
||||
if (omap4_bootsrc() == OMAP_BOOTSRC_USB1) {
|
||||
omap4_usbboot_open();
|
||||
omap4_usbboot_puts("USB communications initialized\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
core_initcall(omap4_usbboot_init);
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* (C) Copyright 2013 Teresa Gámez, Phytec Messtechnik GmbH
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
#include <common.h>
|
||||
#include <envfs.h>
|
||||
#include <init.h>
|
||||
#include <io.h>
|
||||
#include <fs.h>
|
||||
#include <linux/stat.h>
|
||||
#include <mach/generic.h>
|
||||
|
||||
enum omap_boot_src omap_bootsrc(void)
|
||||
{
|
||||
#if defined(CONFIG_ARCH_OMAP3)
|
||||
return omap3_bootsrc();
|
||||
#elif defined(CONFIG_ARCH_OMAP4)
|
||||
return omap4_bootsrc();
|
||||
#elif defined(CONFIG_ARCH_AM33XX)
|
||||
return am33xx_bootsrc();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(CONFIG_DEFAULT_ENVIRONMENT) && defined(CONFIG_MCI_STARTUP)
|
||||
static int omap_env_init(void)
|
||||
{
|
||||
struct stat s;
|
||||
char *diskdev = "/dev/disk0.0";
|
||||
int ret;
|
||||
|
||||
if (omap_bootsrc() != OMAP_BOOTSRC_MMC1)
|
||||
return 0;
|
||||
|
||||
ret = stat(diskdev, &s);
|
||||
if (ret) {
|
||||
printf("no %s. using default env\n", diskdev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
mkdir("/boot", 0666);
|
||||
ret = mount(diskdev, "fat", "/boot");
|
||||
if (ret) {
|
||||
printf("failed to mount %s\n", diskdev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_OMAP_BUILD_IFT))
|
||||
default_environment_path = "/dev/defaultenv";
|
||||
else
|
||||
default_environment_path = "/boot/barebox.env";
|
||||
|
||||
return 0;
|
||||
}
|
||||
late_initcall(omap_env_init);
|
||||
#endif
|
|
@ -6,7 +6,7 @@
|
|||
#include <linux/mtd/mtd.h>
|
||||
#include <fs.h>
|
||||
#include <fcntl.h>
|
||||
#include <mach/xload.h>
|
||||
#include <mach/generic.h>
|
||||
#include <sizes.h>
|
||||
#include <filetype.h>
|
||||
|
||||
|
@ -158,17 +158,6 @@ static void *omap4_xload_boot_usb(void){
|
|||
return buf;
|
||||
}
|
||||
|
||||
enum omap_boot_src omap_bootsrc(void)
|
||||
{
|
||||
#if defined(CONFIG_ARCH_OMAP3)
|
||||
return omap3_bootsrc();
|
||||
#elif defined(CONFIG_ARCH_OMAP4)
|
||||
return omap4_bootsrc();
|
||||
#elif defined(CONFIG_ARCH_AM33XX)
|
||||
return am33xx_bootsrc();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Replaces the default shell in xload configuration
|
||||
*/
|
||||
|
|
|
@ -38,4 +38,11 @@ config KEYBOARD_QT1070
|
|||
Say Y here if you want to use Atmel AT42QT1070 QTouch
|
||||
Sensor chip as input device.
|
||||
|
||||
config KEYBOARD_TWL6030
|
||||
tristate "TWL6030 power button"
|
||||
depends on MFD_TWL6030
|
||||
select POLLER
|
||||
help
|
||||
Say Y here if you want to use TWL6030 power button as a key.
|
||||
|
||||
endmenu
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o
|
||||
obj-$(CONFIG_KEYBOARD_TWL6030) += twl6030_pwrbtn.o
|
||||
obj-$(CONFIG_KEYBOARD_IMX_KEYPAD) += imx_keypad.o
|
||||
obj-$(CONFIG_KEYBOARD_QT1070) += qt1070.o
|
||||
|
|
|
@ -86,6 +86,8 @@ static int __init gpio_keys_probe(struct device_d *dev)
|
|||
return ret;
|
||||
}
|
||||
gpio_direction_input(gpio);
|
||||
pdata->buttons[i].previous_state =
|
||||
pdata->buttons[i].active_low;
|
||||
}
|
||||
|
||||
pdata->poller.func = gpio_key_poller;
|
||||
|
|
|
@ -0,0 +1,108 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <init.h>
|
||||
#include <malloc.h>
|
||||
#include <poller.h>
|
||||
#include <kfifo.h>
|
||||
#include <mfd/twl6030.h>
|
||||
#include <twl6030_pwrbtn.h>
|
||||
|
||||
struct twl6030_pwrbtn_internal_data {
|
||||
int code;
|
||||
u8 previous_state;
|
||||
struct twl6030 *twl6030;
|
||||
struct kfifo *recv_fifo;
|
||||
struct console_device cdev;
|
||||
struct poller_struct poller;
|
||||
};
|
||||
|
||||
#define PWR_PWRON_IRQ (1 << 0)
|
||||
|
||||
static void ic2_key_poller(struct poller_struct *poller)
|
||||
{
|
||||
struct twl6030_pwrbtn_internal_data *idata = container_of(
|
||||
poller, struct twl6030_pwrbtn_internal_data, poller);
|
||||
u8 val;
|
||||
|
||||
if (twl6030_reg_read(idata->twl6030, TWL6030_PMCM_HW, &val)) {
|
||||
dev_err(idata->cdev.dev, "reading i2c\n");
|
||||
return;
|
||||
}
|
||||
val = !(val & PWR_PWRON_IRQ);
|
||||
if (val != idata->previous_state && val) {
|
||||
kfifo_put(idata->recv_fifo, (u_char *)&idata->code,
|
||||
sizeof(int));
|
||||
dev_dbg(idata->cdev.dev, "pressed power button as %d\n",
|
||||
idata->code);
|
||||
}
|
||||
idata->previous_state = val;
|
||||
}
|
||||
|
||||
static int twl6030_pwrbtn_tstc(struct console_device *cdev)
|
||||
{
|
||||
struct twl6030_pwrbtn_internal_data *idata = container_of(
|
||||
cdev, struct twl6030_pwrbtn_internal_data, cdev);
|
||||
|
||||
return kfifo_len(idata->recv_fifo) ? 1 : 0;
|
||||
}
|
||||
|
||||
static int twl6030_pwrbtn_getc(struct console_device *cdev)
|
||||
{
|
||||
int code = 0;
|
||||
struct twl6030_pwrbtn_internal_data *idata = container_of(
|
||||
cdev, struct twl6030_pwrbtn_internal_data, cdev);
|
||||
|
||||
kfifo_get(idata->recv_fifo, (u_char *)&code, sizeof(int));
|
||||
return code;
|
||||
}
|
||||
|
||||
static int __init twl6030_pwrbtn_probe(struct device_d *dev)
|
||||
{
|
||||
struct twl6030_pwrbtn_internal_data *idata;
|
||||
struct twl6030_pwrbtn_platform_data *pdata;
|
||||
|
||||
pdata = dev->platform_data;
|
||||
if (!pdata) {
|
||||
dev_err(dev, "missing platform_data\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
idata = xzalloc(sizeof(struct twl6030_pwrbtn_internal_data));
|
||||
|
||||
idata->recv_fifo = kfifo_alloc(sizeof(int));
|
||||
if (!idata->recv_fifo) {
|
||||
dev_err(dev, "out of memory allocating kfifo\n");
|
||||
free(idata);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
idata->code = pdata->code;
|
||||
idata->twl6030 = twl6030_get();
|
||||
idata->poller.func = ic2_key_poller;
|
||||
|
||||
dev->type_data = &idata->cdev;
|
||||
idata->cdev.dev = dev;
|
||||
idata->cdev.f_caps = CONSOLE_STDIN;
|
||||
idata->cdev.tstc = twl6030_pwrbtn_tstc;
|
||||
idata->cdev.getc = twl6030_pwrbtn_getc;
|
||||
console_register(&idata->cdev);
|
||||
|
||||
return poller_register(&idata->poller);
|
||||
}
|
||||
|
||||
static struct driver_d twl6030_pwrbtn_driver = {
|
||||
.name = "twl6030_pwrbtn",
|
||||
.probe = twl6030_pwrbtn_probe,
|
||||
};
|
||||
device_platform_driver(twl6030_pwrbtn_driver);
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef _TWL6030_PWRBTN_H
|
||||
#define _TWL6030_PWRBTN_H
|
||||
|
||||
struct twl6030_pwrbtn_platform_data {
|
||||
/* key code */
|
||||
int code;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue