1
0
mirror of https://git.yoctoproject.org/meta-ti synced 2026-05-07 03:49:20 +00:00

linux-am335x-joel 3.1rc: initial add

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
This commit is contained in:
Koen Kooi
2011-09-27 15:41:35 +02:00
parent dd497f403f
commit 55f728da71
6 changed files with 3677 additions and 0 deletions
@@ -0,0 +1,95 @@
From c8ecfb4e84c80d96c2582430d9ffab996f5ab422 Mon Sep 17 00:00:00 2001
From: Steve Kipisz <s-kipisz2@ti.com>
Date: Thu, 6 Oct 2011 15:56:51 -0500
Subject: [PATCH 1/2] Add minimal hacked beaglebone support to the board file.
---
arch/arm/mach-omap2/board-am335xevm.c | 44 ++++++++++++++++++++++++++++++--
1 files changed, 41 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
index 0b91789..0f47b65 100644
--- a/arch/arm/mach-omap2/board-am335xevm.c
+++ b/arch/arm/mach-omap2/board-am335xevm.c
@@ -396,6 +396,21 @@ static struct pinmux_config mii1_pin_mux[] = {
{NULL, 0},
};
+/* Module pin mux for rmii1 */
+static struct pinmux_config rmii1_pin_mux[] = {
+ {"mii1_crs.rmii1_crs_dv", OMAP_MUX_MODE1 | AM335X_PIN_INPUT_PULLDOWN},
+ {"mii1_rxerr.mii1_rxerr", OMAP_MUX_MODE1 | AM335X_PIN_INPUT_PULLDOWN},
+ {"mii1_txen.mii1_txen", OMAP_MUX_MODE1 | AM335X_PIN_OUTPUT},
+ {"mii1_txd1.mii1_txd1", OMAP_MUX_MODE1 | AM335X_PIN_OUTPUT},
+ {"mii1_txd0.mii1_txd0", OMAP_MUX_MODE1 | AM335X_PIN_OUTPUT},
+ {"mii1_rxd1.mii1_rxd1", OMAP_MUX_MODE1 | AM335X_PIN_INPUT_PULLDOWN},
+ {"mii1_rxd0.mii1_rxd0", OMAP_MUX_MODE1 | AM335X_PIN_INPUT_PULLDOWN},
+ {"rmii1_refclk.rmii1_refclk", OMAP_MUX_MODE0 | AM335X_PIN_INPUT_PULLDOWN},
+ {"mdio_data.mdio_data", OMAP_MUX_MODE0 | AM335X_PIN_INPUT_PULLUP},
+ {"mdio_clk.mdio_clk", OMAP_MUX_MODE0 | AM335X_PIN_OUTPUT_PULLUP},
+ {NULL, 0},
+};
+
static struct pinmux_config i2c1_pin_mux[] = {
{"spi0_d1.i2c1_sda", OMAP_MUX_MODE2 | AM335X_SLEWCTRL_SLOW |
AM335X_PULL_ENBL | AM335X_INPUT_EN},
@@ -634,6 +649,12 @@ static void mii1_init(int evm_id, int profile)
return;
}
+static void rmii1_init(int evm_id, int profile)
+{
+ setup_pin_mux(rmii1_pin_mux);
+ return;
+}
+
static void usb0_init(int evm_id, int profile)
{
setup_pin_mux(usb0_pin_mux);
@@ -816,6 +837,16 @@ static struct evm_dev_cfg ip_phn_evm_dev_cfg[] = {
{NULL, 0, 0},
};
+/* Beaglebone */
+static struct evm_dev_cfg beaglebone_dev_cfg[] = {
+ {rmii1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
+ {usb0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
+ {usb1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
+ {mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
+ {i2c1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
+ {NULL, 0, 0},
+};
+
static void setup_low_cost_evm(void)
{
pr_info("The board is a AM335x Low Cost EVM.\n");
@@ -858,6 +889,13 @@ static void setup_ip_phone_evm(void)
_configure_device(IP_PHN_EVM, ip_phn_evm_dev_cfg, PROFILE_NONE);
}
+static void setup_beaglebone(void)
+{
+ pr_info("The board is a AM335x Beaglebone.\n");
+
+ _configure_device(LOW_COST_EVM, beaglebone_dev_cfg, PROFILE_NONE);
+}
+
static void am335x_setup_daughter_board(struct memory_accessor *m, void *c)
{
u8 tmp;
@@ -933,9 +971,9 @@ out:
* eventually be changed to assume a minimal configuration
*/
pr_err("Could not detect any board, falling back to: "
- "General purpose EVM in profile 0 with daughter card connected\n");
- daughter_brd_detected = true;
- setup_general_purpose_evm();
+ "Beaglebone in profile 0 with no daughter card connected\n");
+ daughter_brd_detected = false;
+ setup_beaglebone();
/* Initialize cpsw after board detection is completed as board
* information is required for configuring phy address and hence
--
1.6.6.1
@@ -0,0 +1,108 @@
From ed2b4469ce07a6e3aec681a26010753c1e20551f Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Fri, 7 Oct 2011 14:39:31 +0200
Subject: [PATCH] am335x-evm: hack in LED support for beaglebone
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
arch/arm/mach-omap2/board-am335xevm.c | 63 +++++++++++++++++++++++++++++++++
1 files changed, 63 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
index 0f47b65..82804a9 100644
--- a/arch/arm/mach-omap2/board-am335xevm.c
+++ b/arch/arm/mach-omap2/board-am335xevm.c
@@ -17,6 +17,7 @@
#include <linux/i2c.h>
#include <linux/i2c/at24.h>
#include <linux/gpio.h>
+#include <linux/leds.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
@@ -559,6 +560,58 @@ static struct pinmux_config usb1_pin_mux[] = {
{NULL, 0},
};
+/* LEDS - gpio1_21 -> gpio1_24 */
+
+#define BEAGLEBONE_USR1_LED GPIO_TO_PIN(1, 21)
+#define BEAGLEBONE_USR2_LED GPIO_TO_PIN(1, 22)
+#define BEAGLEBONE_USR3_LED GPIO_TO_PIN(1, 23)
+#define BEAGLEBONE_USR4_LED GPIO_TO_PIN(1, 24)
+
+static struct gpio_led gpio_leds[] = {
+ {
+ .name = "beaglebone::usr0",
+ .default_trigger = "heartbeat",
+ .gpio = BEAGLEBONE_USR1_LED,
+ },
+ {
+ .name = "beaglebone::usr1",
+ .default_trigger = "mmc0",
+ .gpio = BEAGLEBONE_USR2_LED,
+ },
+ {
+ .name = "beaglebone::usr2",
+ .gpio = BEAGLEBONE_USR3_LED,
+ },
+ {
+ .name = "beaglebone::usr3",
+ .gpio = BEAGLEBONE_USR4_LED,
+ },
+};
+
+static struct gpio_led_platform_data gpio_led_info = {
+ .leds = gpio_leds,
+ .num_leds = ARRAY_SIZE(gpio_leds),
+};
+
+static struct platform_device leds_gpio = {
+ .name = "leds-gpio",
+ .id = -1,
+ .dev = {
+ .platform_data = &gpio_led_info,
+ },
+};
+
+static struct platform_device *bone_devices[] __initdata = {
+ &leds_gpio,
+};
+
+static struct pinmux_config boneled_pin_mux[] = {
+ {"gpmc_a5.rgmii2_td0", OMAP_MUX_MODE7 | AM335X_PIN_OUTPUT}, // gpio 21
+ {"gpmc_a6.rgmii2_tclk", OMAP_MUX_MODE7 | AM335X_PIN_OUTPUT}, // gpio22
+ {"gpmc_a7.rgmii2_rclk", OMAP_MUX_MODE7 | AM335X_PIN_OUTPUT}, // gpio23
+ {"gpmc_a8.rgmii2_rd3", OMAP_MUX_MODE7 | AM335X_PIN_OUTPUT}, // gpio 24
+};
+
/* Module pin mux for eCAP0 */
static struct pinmux_config ecap0_pin_mux[] = {
{"ecap0_in_pwm0_out.gpio0_7", AM335X_PIN_OUTPUT},
@@ -631,6 +684,15 @@ static void tsc_init(int evm_id, int profile)
pr_err("failed to register touchscreen device\n");
}
+static void bone_leds_init(int evm_id, int profil )
+{
+ int err;
+ setup_pin_mux(boneled_pin_mux);
+ err = platform_add_devices(bone_devices, ARRAY_SIZE(bone_devices));
+ if (err)
+ pr_err("failed to register LEDS\n");
+}
+
static void rgmii1_init(int evm_id, int profile)
{
setup_pin_mux(rgmii1_pin_mux);
@@ -844,6 +906,7 @@ static struct evm_dev_cfg beaglebone_dev_cfg[] = {
{usb1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{i2c1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
+ {bone_leds_init, DEV_ON_BASEBOARD, PROFILE_ALL},
{NULL, 0, 0},
};
--
1.6.6.1
@@ -0,0 +1,31 @@
From 728dac2a525b9516ab22f78ec9c17d0862379085 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Fri, 7 Oct 2011 15:29:28 +0200
Subject: [PATCH] f_rndis: HACK around undefined variables
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
drivers/usb/gadget/f_rndis.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c
index 2d4e9eb..06114da 100644
--- a/drivers/usb/gadget/f_rndis.c
+++ b/drivers/usb/gadget/f_rndis.c
@@ -775,11 +775,11 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
rndis_set_param_medium(rndis->config, NDIS_MEDIUM_802_3, 0);
rndis_set_host_mac(rndis->config, rndis->ethaddr);
-
+/*
if (rndis_set_param_vendor(rndis->config, vendorID,
manufacturer))
goto fail;
-
+*/
/* NOTE: all that is done without knowing or caring about
* the network link ... which is unavailable to this code
* until we're activated via set_alt().
--
1.6.6.1
@@ -0,0 +1,25 @@
From 5f4a12f2ab8c8a686875434bc9d4d60af5b16866 Mon Sep 17 00:00:00 2001
From: Steve Kipisz <s-kipisz2@ti.com>
Date: Thu, 6 Oct 2011 15:57:45 -0500
Subject: [PATCH 1/1] Enable bit15 in the maccontrol register for 100Mbps.
---
drivers/net/cpsw.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index 402d8f6..080388c 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -399,6 +399,8 @@ static void _cpsw_adjust_link(struct cpsw_slave *slave,
mac_control &= ~BIT(7); /* TODO: Do not enable */
phy->speed = 100; /* gig support now */
}
+ if (phy->speed == 100)
+ mac_control |= BIT(15);
if (phy->duplex)
mac_control |= BIT(0); /* FULLDUPLEXEN */
if (phy->interface == PHY_INTERFACE_MODE_RGMII) /* RGMII */
--
1.7.2.3
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,22 @@
require linux.inc
DESCRIPTION = "Linux kernel for AM335x processors"
KERNEL_IMAGETYPE = "uImage"
COMPATIBLE_MACHINE = "beaglebone"
SRCREV = "d3a2a2a1426ec59fcba80bf400e3261b2a3108c2"
# The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc
MACHINE_KERNEL_PR_append = "c+gitr${SRCREV}"
SRC_URI = "git://github.com/joelagnel/linux-omap-2.6.git;branch=kernel-3.1-psp \
file://0001-f_rndis-HACK-around-undefined-variables.patch \
file://0002-Enable-bit15-in-the-maccontrol-register-for-100Mbps.patch \
file://0001-Add-minimal-hacked-beaglebone-support-to-the-board-f.patch \
file://0001-am335x-evm-hack-in-LED-support-for-beaglebone.patch \
file://defconfig"
S = "${WORKDIR}/git"