Adding Beagleboard support - unfinished

The beagleboard target is still unfinied:

running:
- MMC Card (incl. boot)
- DSS2 graphic driver

missing:
- full USB Host and Gadget

TODO:
- improve graphic support
- full boot from flash and SD - incl. update
- XServer
- Gaming support

SVN-Revision: 18775
This commit is contained in:
Jens Muecke 2009-12-14 10:35:16 +00:00
parent 623e37166c
commit 2e00cd6d71
11 changed files with 35111 additions and 0 deletions

View file

@ -0,0 +1,25 @@
#
# Copyright (C) 2006-2009 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
ARCH:=arm
BOARD:=beagleboard
BOARDNAME:=beagleboard
FEATURES:=ext2 usb broken
LINUX_VERSION:=2.6.32-rc5
KERNELNAME:="uImage"
DEVICE_TYPE=developerboard
define Target/Description
beagleboard - www.beagleboard.org - omap3 arm
endef
include $(INCLUDE_DIR)/target.mk
$(eval $(call BuildTarget))

View file

@ -0,0 +1,14 @@
# Copyright (C) 2006 OpenWrt.org
config interface loopback
option ifname lo
option proto static
option ipaddr 127.0.0.1
option netmask 255.0.0.0
config interface lan
option ifname usb0
option type bridge
option proto static
option ipaddr 192.168.1.1
option netmask 255.255.255.0

View file

@ -0,0 +1,7 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K stop
tts/0::askfirst:/bin/ash --login
ttyS0::askfirst:/bin/ash --login
ttyS1::askfirst:/bin/ash --login
ttyS2::askfirst:/bin/ash --login
tty1::askfirst:/bin/ash --login

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,10 @@
echo -----------------------------
echo u-boot.cmd
echo Kernel: MMC0P1:uImage
echo RootFS: MMC0P2
echo VideoMode: 640x480@60
echo VideoSpec: omapfb:vram:2M,vram:4M
echo -----------------------------
setenv bootargs 'console=ttyS2,115200n8 console=tty0 root=/dev/mmcblk0p2 rw rootwait nohz=off video=omapfb:vram:1M,vxres:640,vyres:480'
fatload mmc 0 83000000 uImage
bootm 83000000

View file

@ -0,0 +1,36 @@
#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
JFFS2_BLOCKSIZE=128k
JFFS2OPTS += --little-endian --pagesize=0x800 --no-cleanmarkers --pad
MAKE += -j5
define Image/BuildKernel
$(TARGET_CROSS)objcopy -O binary -R .note -R .comment -S $(LINUX_DIR)/arch/arm/boot/compressed/vmlinux linux.bin
mkimage -A arm -O linux -T kernel -C none -a 80008000 -e 80008000 -n "OpenWRT Kernel Image beagleboard" -d linux.bin uImage
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n 'uImage.bin+mmc2' -d ../files/boot-mmc.cmd boot.scr
mv uImage $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-uImage
mv boot.scr $(BIN_DIR)/boot.scr
rm linux.bin
endef
define Image/Build/squashfs
$(call prepare_generic_squashfs,$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-root.$(1))
endef
define Image/Build
$(CP) $(KDIR)/root.$(1) $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-root.$(1)
PADDING="true" PATH="$(TARGET_PATH)" ./gen_image.sh $(BIN_DIR)/openwrt-$(BOARD)-$(1).image 4 $(KDIR)/root.bootscript 240 $(KDIR)/root.$(1)
$(call Image/Build/$(1),$(1))
endef
$(eval $(call BuildImage))

View file

@ -0,0 +1,35 @@
#!/usr/bin/env bash
# Copyright (C) 2006 - 2007 OpenWrt.org
set -x
[ $# == 5 ] || {
echo "SYNTAX: $0 <file> <kernel size> <kernel directory> <rootfs size> <rootfs image>"
exit 1
}
OUTPUT="$1"
KERNELSIZE="$2"
KERNELDIR="$3"
ROOTFSSIZE="$4"
ROOTFSIMAGE="$5"
rm -f "$OUTPUT"
head=16
sect=63
cyl=$(( ($KERNELSIZE + $ROOTFSSIZE) * 1024 * 1024 / ($head * $sect * 512)))
# create partition table
set `ptgen -o "$OUTPUT" -h $head -s $sect -p ${KERNELSIZE}m -p ${ROOTFSSIZE}m`
KERNELOFFSET="$(($1 / 512))"
KERNELSIZE="$(($2 / 512))"
ROOTFSOFFSET="$(($3 / 512))"
ROOTFSSIZE="$(($4 / 512))"
BLOCKS="$((($KERNELSIZE / 2) - 1))"
genext2fs -d "$KERNELDIR" -b "$BLOCKS" "$OUTPUT.kernel"
dd if="$OUTPUT.kernel" of="$OUTPUT" bs=512 seek="$KERNELOFFSET" conv=notrunc
[ -n "$PADDING" ] && dd if=/dev/zero of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc count="$ROOTFSSIZE"
dd if="$ROOTFSIMAGE" of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc
#rm -f "$OUTPUT.kernel"

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,195 @@
--- a/arch/arm/mach-omap2/board-omap3beagle.c 2009-11-27 02:38:04.000000000 +0100
+++ b/arch/arm/mach-omap2/board-omap3beagle.c 2009-11-27 00:36:10.511677848 +0100
@@ -23,6 +23,7 @@
#include <linux/gpio.h>
#include <linux/input.h>
#include <linux/gpio_keys.h>
+#include <linux/omapfb.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
@@ -44,6 +45,7 @@
#include <mach/mux.h>
#include <mach/usb.h>
#include <mach/timer-gp.h>
+#include <mach/display.h>
#include "mmc-twl4030.h"
@@ -106,6 +108,92 @@ static struct platform_device omap3beagl
.resource = &omap3beagle_nand_resource,
};
+/* DSS */
+
+static int beagle_enable_dvi(struct omap_dss_device *dssdev)
+{
+ if (dssdev->reset_gpio != -1)
+ gpio_set_value(dssdev->reset_gpio, 1);
+
+ return 0;
+}
+
+static void beagle_disable_dvi(struct omap_dss_device *dssdev)
+{
+ if (dssdev->reset_gpio != -1)
+ gpio_set_value(dssdev->reset_gpio, 0);
+}
+
+static struct omap_dss_device beagle_dvi_device = {
+ .type = OMAP_DISPLAY_TYPE_DPI,
+ .name = "dvi",
+ .driver_name = "generic_panel",
+ .phy.dpi.data_lines = 24,
+ .reset_gpio = 170,
+ .platform_enable = beagle_enable_dvi,
+ .platform_disable = beagle_disable_dvi,
+};
+
+static int beagle_panel_enable_tv(struct omap_dss_device *dssdev)
+{
+ return 0;
+}
+
+static void beagle_panel_disable_tv(struct omap_dss_device *dssdev)
+{
+}
+
+static struct omap_dss_device beagle_tv_device = {
+ .name = "tv",
+ .driver_name = "venc",
+ .type = OMAP_DISPLAY_TYPE_VENC,
+ .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
+ .platform_enable = beagle_panel_enable_tv,
+ .platform_disable = beagle_panel_disable_tv,
+};
+
+static struct omap_dss_device *beagle_dss_devices[] = {
+ &beagle_dvi_device,
+ &beagle_tv_device,
+};
+
+static struct omap_dss_board_info beagle_dss_data = {
+ .num_devices = ARRAY_SIZE(beagle_dss_devices),
+ .devices = beagle_dss_devices,
+ .default_device = &beagle_dvi_device,
+};
+
+static struct platform_device beagle_dss_device = {
+ .name = "omapdss",
+ .id = -1,
+ .dev = {
+ .platform_data = &beagle_dss_data,
+ },
+};
+
+static struct regulator_consumer_supply beagle_vdda_dac_supply = {
+ .supply = "vdda_dac",
+ .dev = &beagle_dss_device.dev,
+};
+
+static struct regulator_consumer_supply beagle_vdds_dsi_supply = {
+ .supply = "vdds_dsi",
+ .dev = &beagle_dss_device.dev,
+};
+
+static void __init beagle_display_init(void)
+{
+ int r;
+
+ r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset");
+ if (r < 0) {
+ printk(KERN_ERR "Unable to get DVI reset GPIO\n");
+ return;
+ }
+
+ gpio_direction_output(beagle_dvi_device.reset_gpio, 0);
+}
+
#include "sdram-micron-mt46h32m32lf-6.h"
static struct twl4030_hsmmc_info mmc[] = {
@@ -117,15 +205,6 @@ static struct twl4030_hsmmc_info mmc[] =
{} /* Terminator */
};
-static struct platform_device omap3_beagle_lcd_device = {
- .name = "omap3beagle_lcd",
- .id = -1,
-};
-
-static struct omap_lcd_config omap3_beagle_lcd_config __initdata = {
- .ctrl_name = "internal",
-};
-
static struct regulator_consumer_supply beagle_vmmc1_supply = {
.supply = "vmmc",
};
@@ -181,15 +260,6 @@ static struct twl4030_gpio_platform_data
.setup = beagle_twl_gpio_setup,
};
-static struct regulator_consumer_supply beagle_vdac_supply = {
- .supply = "vdac",
- .dev = &omap3_beagle_lcd_device.dev,
-};
-
-static struct regulator_consumer_supply beagle_vdvi_supply = {
- .supply = "vdvi",
- .dev = &omap3_beagle_lcd_device.dev,
-};
/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
static struct regulator_init_data beagle_vmmc1 = {
@@ -226,13 +296,14 @@ static struct regulator_init_data beagle
.constraints = {
.min_uV = 1800000,
.max_uV = 1800000,
+ .apply_uV = true,
.valid_modes_mask = REGULATOR_MODE_NORMAL
| REGULATOR_MODE_STANDBY,
.valid_ops_mask = REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS,
},
.num_consumer_supplies = 1,
- .consumer_supplies = &beagle_vdac_supply,
+ .consumer_supplies = &beagle_vdda_dac_supply,
};
/* VPLL2 for digital video outputs */
@@ -247,7 +318,7 @@ static struct regulator_init_data beagle
| REGULATOR_CHANGE_STATUS,
},
.num_consumer_supplies = 1,
- .consumer_supplies = &beagle_vdvi_supply,
+ .consumer_supplies = &beagle_vdds_dsi_supply,
};
static struct twl4030_usb_data beagle_usb_data = {
@@ -340,7 +411,6 @@ static struct platform_device keys_gpio
};
static struct omap_board_config_kernel omap3_beagle_config[] __initdata = {
- { OMAP_TAG_LCD, &omap3_beagle_lcd_config },
};
static void __init omap3_beagle_init_irq(void)
@@ -357,7 +427,7 @@ static void __init omap3_beagle_init_irq
}
static struct platform_device *omap3_beagle_devices[] __initdata = {
- &omap3_beagle_lcd_device,
+ &beagle_dss_device,
&leds_gpio,
&keys_gpio,
};
@@ -420,9 +490,6 @@ static void __init omap3_beagle_init(voi
omap_serial_init();
omap_cfg_reg(J25_34XX_GPIO170);
- gpio_request(170, "DVI_nPD");
- /* REVISIT leave DVI powered down until it's needed ... */
- gpio_direction_output(170, true);
usb_musb_init();
usb_ehci_init(&ehci_pdata);

View file

@ -0,0 +1,13 @@
--- a/drivers/video/omap2/dss/dispc.c 2009-11-29 18:41:44.396505079 +0100
+++ b/drivers/video/omap2/dss/dispc.c 2009-11-09 00:19:03.466830538 +0100
@@ -3077,8 +3077,8 @@ static void _omap_dispc_initial_config(v
REG_FLD_MOD(DISPC_CONFIG, 1, 9, 9);
/* L3 firewall setting: enable access to OCM RAM */
- if (cpu_is_omap24xx())
- __raw_writel(0x402000b0, OMAP2_IO_ADDRESS(0x680050a0));
+// if (cpu_is_omap24xx())
+// __raw_writel(0x402000b0, OMAP2_IO_ADDRESS(0x680050a0));
_dispc_setup_color_conv_coef();