linux-am335x-joel 3.1rc: initial add
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-am335x-joel-3.1 / 0001-Add-minimal-hacked-beaglebone-support-to-the-board-f.patch
1 From c8ecfb4e84c80d96c2582430d9ffab996f5ab422 Mon Sep 17 00:00:00 2001
2 From: Steve Kipisz <s-kipisz2@ti.com>
3 Date: Thu, 6 Oct 2011 15:56:51 -0500
4 Subject: [PATCH 1/2] Add minimal hacked beaglebone support to the board file.
6 ---
7  arch/arm/mach-omap2/board-am335xevm.c |   44 ++++++++++++++++++++++++++++++--
8  1 files changed, 41 insertions(+), 3 deletions(-)
10 diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
11 index 0b91789..0f47b65 100644
12 --- a/arch/arm/mach-omap2/board-am335xevm.c
13 +++ b/arch/arm/mach-omap2/board-am335xevm.c
14 @@ -396,6 +396,21 @@ static struct pinmux_config mii1_pin_mux[] = {
15         {NULL, 0},
16  };
17  
18 +/* Module pin mux for rmii1 */
19 +static struct pinmux_config rmii1_pin_mux[] = {
20 +       {"mii1_crs.rmii1_crs_dv", OMAP_MUX_MODE1 | AM335X_PIN_INPUT_PULLDOWN},
21 +       {"mii1_rxerr.mii1_rxerr", OMAP_MUX_MODE1 | AM335X_PIN_INPUT_PULLDOWN},
22 +       {"mii1_txen.mii1_txen", OMAP_MUX_MODE1 | AM335X_PIN_OUTPUT},
23 +       {"mii1_txd1.mii1_txd1", OMAP_MUX_MODE1 | AM335X_PIN_OUTPUT},
24 +       {"mii1_txd0.mii1_txd0", OMAP_MUX_MODE1 | AM335X_PIN_OUTPUT},
25 +       {"mii1_rxd1.mii1_rxd1", OMAP_MUX_MODE1 | AM335X_PIN_INPUT_PULLDOWN},
26 +       {"mii1_rxd0.mii1_rxd0", OMAP_MUX_MODE1 | AM335X_PIN_INPUT_PULLDOWN},
27 +       {"rmii1_refclk.rmii1_refclk", OMAP_MUX_MODE0 | AM335X_PIN_INPUT_PULLDOWN},
28 +       {"mdio_data.mdio_data", OMAP_MUX_MODE0 | AM335X_PIN_INPUT_PULLUP},
29 +       {"mdio_clk.mdio_clk", OMAP_MUX_MODE0 | AM335X_PIN_OUTPUT_PULLUP},
30 +       {NULL, 0},
31 +};
32 +
33  static struct pinmux_config i2c1_pin_mux[] = {
34         {"spi0_d1.i2c1_sda",    OMAP_MUX_MODE2 | AM335X_SLEWCTRL_SLOW |
35                                         AM335X_PULL_ENBL | AM335X_INPUT_EN},
36 @@ -634,6 +649,12 @@ static void mii1_init(int evm_id, int profile)
37         return;
38  }
39  
40 +static void rmii1_init(int evm_id, int profile)
41 +{
42 +       setup_pin_mux(rmii1_pin_mux);
43 +       return;
44 +}
45 +
46  static void usb0_init(int evm_id, int profile)
47  {
48         setup_pin_mux(usb0_pin_mux);
49 @@ -816,6 +837,16 @@ static struct evm_dev_cfg ip_phn_evm_dev_cfg[] = {
50         {NULL, 0, 0},
51  };
52  
53 +/* Beaglebone */
54 +static struct evm_dev_cfg beaglebone_dev_cfg[] = {
55 +       {rmii1_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
56 +       {usb0_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
57 +       {usb1_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
58 +       {mmc0_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
59 +       {i2c1_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
60 +       {NULL, 0, 0},
61 +};
62 +
63  static void setup_low_cost_evm(void)
64  {
65         pr_info("The board is a AM335x Low Cost EVM.\n");
66 @@ -858,6 +889,13 @@ static void setup_ip_phone_evm(void)
67         _configure_device(IP_PHN_EVM, ip_phn_evm_dev_cfg, PROFILE_NONE);
68  }
69  
70 +static void setup_beaglebone(void)
71 +{
72 +       pr_info("The board is a AM335x Beaglebone.\n");
73 +
74 +       _configure_device(LOW_COST_EVM, beaglebone_dev_cfg, PROFILE_NONE);
75 +}
76 +
77  static void am335x_setup_daughter_board(struct memory_accessor *m, void *c)
78  {
79         u8 tmp;
80 @@ -933,9 +971,9 @@ out:
81          * eventually be changed to assume a minimal configuration
82          */
83         pr_err("Could not detect any board, falling back to: "
84 -               "General purpose EVM in profile 0 with daughter card connected\n");
85 -       daughter_brd_detected = true;
86 -       setup_general_purpose_evm();
87 +               "Beaglebone in profile 0 with no daughter card connected\n");
88 +       daughter_brd_detected = false;
89 +       setup_beaglebone();
90  
91         /* Initialize cpsw after board detection is completed as board
92          * information is required for configuring phy address and hence
93 -- 
94 1.6.6.1