diff options
author | Koen Kooi <koen@dominion.thruhere.net> | 2011-06-23 17:20:05 +0200 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2011-06-23 17:20:05 +0200 |
commit | fc0906ecc74bd53f4b3f46cce5cb84e6397cce41 (patch) | |
tree | f923019266a76366f3a5bf9f7f4a8b354d5da9e5 | |
parent | 149195825c8511514081ae47d8c702a6bcd0e248 (diff) | |
download | meta-ti-fc0906ecc74bd53f4b3f46cce5cb84e6397cce41.tar.gz |
u-boot: add 2011.06rc recipe for beagle and panda
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
31 files changed, 2997 insertions, 0 deletions
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0001-OMAP3-Beagle-Pin-Mux-initialization-glitch-fix.patch b/recipes-bsp/u-boot/u-boot/2011.06/0001-OMAP3-Beagle-Pin-Mux-initialization-glitch-fix.patch new file mode 100644 index 00000000..6463a80e --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0001-OMAP3-Beagle-Pin-Mux-initialization-glitch-fix.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From 8892464287ca16f90397f159370f0d42ff6dc879 Mon Sep 17 00:00:00 2001 | ||
2 | From: Bob Feretich <bob.feretich@rafresearch.com> | ||
3 | Date: Thu, 24 Feb 2011 13:16:44 +0000 | ||
4 | Subject: [PATCH 01/30] OMAP3 Beagle Pin Mux initialization glitch fix | ||
5 | |||
6 | The below patch reverses the order of two segments in the board file. | ||
7 | Output pins need to have their values initialized, before they are | ||
8 | exposed to the logic outside the chip. | ||
9 | |||
10 | Signed-off-by: Bob Feretich <bob.feretich@rafresearch.com> | ||
11 | Cc: Wolfgang Denk <wd@denx.de> | ||
12 | --- | ||
13 | board/ti/beagle/beagle.c | 12 ++++++------ | ||
14 | 1 files changed, 6 insertions(+), 6 deletions(-) | ||
15 | |||
16 | diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c | ||
17 | index ab50514..15d061a 100644 | ||
18 | --- a/board/ti/beagle/beagle.c | ||
19 | +++ b/board/ti/beagle/beagle.c | ||
20 | @@ -301,17 +301,17 @@ int misc_init_r(void) | ||
21 | twl4030_power_init(); | ||
22 | twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON); | ||
23 | |||
24 | - /* Configure GPIOs to output */ | ||
25 | - writel(~(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1), &gpio6_base->oe); | ||
26 | - writel(~(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 | | ||
27 | - GPIO15 | GPIO14 | GPIO13 | GPIO12), &gpio5_base->oe); | ||
28 | - | ||
29 | - /* Set GPIOs */ | ||
30 | + /* Set GPIO states before they are made outputs */ | ||
31 | writel(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1, | ||
32 | &gpio6_base->setdataout); | ||
33 | writel(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 | | ||
34 | GPIO15 | GPIO14 | GPIO13 | GPIO12, &gpio5_base->setdataout); | ||
35 | |||
36 | + /* Configure GPIOs to output */ | ||
37 | + writel(~(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1), &gpio6_base->oe); | ||
38 | + writel(~(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 | | ||
39 | + GPIO15 | GPIO14 | GPIO13 | GPIO12), &gpio5_base->oe); | ||
40 | + | ||
41 | dieid_num_r(); | ||
42 | |||
43 | return 0; | ||
44 | -- | ||
45 | 1.6.6.1 | ||
46 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0002-OMAP-Remove-omapfb.debug-y-from-Beagle-and-Overo-env.patch b/recipes-bsp/u-boot/u-boot/2011.06/0002-OMAP-Remove-omapfb.debug-y-from-Beagle-and-Overo-env.patch new file mode 100644 index 00000000..b4906ef9 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0002-OMAP-Remove-omapfb.debug-y-from-Beagle-and-Overo-env.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | From 88ee784eddb634074895d68572b896aebd10bb5d Mon Sep 17 00:00:00 2001 | ||
2 | From: Steve Sakoman <steve@sakoman.com> | ||
3 | Date: Thu, 30 Dec 2010 07:19:44 +0000 | ||
4 | Subject: [PATCH 02/30] OMAP: Remove omapfb.debug=y from Beagle and Overo env settings | ||
5 | |||
6 | The kernel DSS2 code is mature now, and keeping this setting hurts performance | ||
7 | |||
8 | Signed-off-by: Steve Sakoman <steve@sakoman.com> | ||
9 | --- | ||
10 | include/configs/omap3_beagle.h | 2 -- | ||
11 | include/configs/omap3_overo.h | 2 -- | ||
12 | 2 files changed, 0 insertions(+), 4 deletions(-) | ||
13 | |||
14 | diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h | ||
15 | index 9fd80ed..42575f1 100644 | ||
16 | --- a/include/configs/omap3_beagle.h | ||
17 | +++ b/include/configs/omap3_beagle.h | ||
18 | @@ -214,7 +214,6 @@ | ||
19 | "mpurate=${mpurate} " \ | ||
20 | "vram=${vram} " \ | ||
21 | "omapfb.mode=dvi:${dvimode} " \ | ||
22 | - "omapfb.debug=y " \ | ||
23 | "omapdss.def_disp=${defaultdisplay} " \ | ||
24 | "root=${mmcroot} " \ | ||
25 | "rootfstype=${mmcrootfstype}\0" \ | ||
26 | @@ -222,7 +221,6 @@ | ||
27 | "mpurate=${mpurate} " \ | ||
28 | "vram=${vram} " \ | ||
29 | "omapfb.mode=dvi:${dvimode} " \ | ||
30 | - "omapfb.debug=y " \ | ||
31 | "omapdss.def_disp=${defaultdisplay} " \ | ||
32 | "root=${nandroot} " \ | ||
33 | "rootfstype=${nandrootfstype}\0" \ | ||
34 | diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h | ||
35 | index 242b317..0f64054 100644 | ||
36 | --- a/include/configs/omap3_overo.h | ||
37 | +++ b/include/configs/omap3_overo.h | ||
38 | @@ -170,7 +170,6 @@ | ||
39 | "mpurate=${mpurate} " \ | ||
40 | "vram=${vram} " \ | ||
41 | "omapfb.mode=dvi:${dvimode} " \ | ||
42 | - "omapfb.debug=y " \ | ||
43 | "omapdss.def_disp=${defaultdisplay} " \ | ||
44 | "root=${mmcroot} " \ | ||
45 | "rootfstype=${mmcrootfstype}\0" \ | ||
46 | @@ -178,7 +177,6 @@ | ||
47 | "mpurate=${mpurate} " \ | ||
48 | "vram=${vram} " \ | ||
49 | "omapfb.mode=dvi:${dvimode} " \ | ||
50 | - "omapfb.debug=y " \ | ||
51 | "omapdss.def_disp=${defaultdisplay} " \ | ||
52 | "root=${nandroot} " \ | ||
53 | "rootfstype=${nandrootfstype}\0" \ | ||
54 | -- | ||
55 | 1.6.6.1 | ||
56 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0003-OMAP3-beagle-pass-expansionboard-name-in-bootargs.patch b/recipes-bsp/u-boot/u-boot/2011.06/0003-OMAP3-beagle-pass-expansionboard-name-in-bootargs.patch new file mode 100644 index 00000000..b2e3df62 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0003-OMAP3-beagle-pass-expansionboard-name-in-bootargs.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | From 89231bb3ed75ea6801a10d3ea618c8dc83d7e483 Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Mon, 22 Nov 2010 11:51:32 +0100 | ||
4 | Subject: [PATCH 03/30] OMAP3: beagle: pass expansionboard name in bootargs | ||
5 | |||
6 | --- | ||
7 | include/configs/omap3_beagle.h | 13 +++++++++++++ | ||
8 | 1 files changed, 13 insertions(+), 0 deletions(-) | ||
9 | |||
10 | diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h | ||
11 | index 42575f1..d5f98da 100644 | ||
12 | --- a/include/configs/omap3_beagle.h | ||
13 | +++ b/include/configs/omap3_beagle.h | ||
14 | @@ -202,6 +202,7 @@ | ||
15 | "usbtty=cdc_acm\0" \ | ||
16 | "console=ttyS2,115200n8\0" \ | ||
17 | "mpurate=auto\0" \ | ||
18 | + "buddy=none "\ | ||
19 | "vram=12M\0" \ | ||
20 | "dvimode=1024x768MR-16@60\0" \ | ||
21 | "defaultdisplay=dvi\0" \ | ||
22 | @@ -212,6 +213,7 @@ | ||
23 | "nandrootfstype=jffs2\0" \ | ||
24 | "mmcargs=setenv bootargs console=${console} " \ | ||
25 | "mpurate=${mpurate} " \ | ||
26 | + "buddy=${buddy} "\ | ||
27 | "vram=${vram} " \ | ||
28 | "omapfb.mode=dvi:${dvimode} " \ | ||
29 | "omapdss.def_disp=${defaultdisplay} " \ | ||
30 | @@ -219,6 +221,7 @@ | ||
31 | "rootfstype=${mmcrootfstype}\0" \ | ||
32 | "nandargs=setenv bootargs console=${console} " \ | ||
33 | "mpurate=${mpurate} " \ | ||
34 | + "buddy=${buddy} "\ | ||
35 | "vram=${vram} " \ | ||
36 | "omapfb.mode=dvi:${dvimode} " \ | ||
37 | "omapdss.def_disp=${defaultdisplay} " \ | ||
38 | @@ -227,6 +230,16 @@ | ||
39 | "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \ | ||
40 | "importbootenv=echo Importing environment from mmc ...; " \ | ||
41 | "env import -t $loadaddr $filesize\0" \ | ||
42 | + "ramargs=setenv bootargs console=${console} " \ | ||
43 | + "${optargs} " \ | ||
44 | + "mpurate=${mpurate} " \ | ||
45 | + "buddy=${buddy} "\ | ||
46 | + "vram=${vram} " \ | ||
47 | + "omapfb.mode=dvi:${dvimode} " \ | ||
48 | + "omapdss.def_disp=${defaultdisplay} " \ | ||
49 | + "root=${ramroot} " \ | ||
50 | + "rootfstype=${ramrootfstype}\0" \ | ||
51 | + "loadramdisk=fatload mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \ | ||
52 | "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \ | ||
53 | "mmcboot=echo Booting from mmc ...; " \ | ||
54 | "run mmcargs; " \ | ||
55 | -- | ||
56 | 1.6.6.1 | ||
57 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0004-beagleboard-add-support-for-xM-revision-C.patch b/recipes-bsp/u-boot/u-boot/2011.06/0004-beagleboard-add-support-for-xM-revision-C.patch new file mode 100644 index 00000000..dec2839b --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0004-beagleboard-add-support-for-xM-revision-C.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 9890bd3e5a28645214aff9d8d311d6a5bdec6cf9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Fri, 17 Jun 2011 09:37:37 +0200 | ||
4 | Subject: [PATCH 04/30] beagleboard: add support for xM revision C | ||
5 | |||
6 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
7 | --- | ||
8 | board/ti/beagle/beagle.c | 10 ++++++++++ | ||
9 | board/ti/beagle/beagle.h | 1 + | ||
10 | 2 files changed, 11 insertions(+), 0 deletions(-) | ||
11 | |||
12 | diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c | ||
13 | index 15d061a..7768901 100644 | ||
14 | --- a/board/ti/beagle/beagle.c | ||
15 | +++ b/board/ti/beagle/beagle.c | ||
16 | @@ -216,6 +216,16 @@ int misc_init_r(void) | ||
17 | TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, | ||
18 | TWL4030_PM_RECEIVER_DEV_GRP_P1); | ||
19 | break; | ||
20 | + case REVISION_XM_C: | ||
21 | + printf("Beagle xM Rev C\n"); | ||
22 | + setenv("beaglerev", "xMC"); | ||
23 | + MUX_BEAGLE_XM(); | ||
24 | + /* Set VAUX2 to 1.8V for EHCI PHY */ | ||
25 | + twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED, | ||
26 | + TWL4030_PM_RECEIVER_VAUX2_VSEL_18, | ||
27 | + TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, | ||
28 | + TWL4030_PM_RECEIVER_DEV_GRP_P1); | ||
29 | + break; | ||
30 | default: | ||
31 | printf("Beagle unknown 0x%02x\n", get_board_revision()); | ||
32 | MUX_BEAGLE_XM(); | ||
33 | diff --git a/board/ti/beagle/beagle.h b/board/ti/beagle/beagle.h | ||
34 | index a7401b1..04247cd 100644 | ||
35 | --- a/board/ti/beagle/beagle.h | ||
36 | +++ b/board/ti/beagle/beagle.h | ||
37 | @@ -39,6 +39,7 @@ const omap3_sysinfo sysinfo = { | ||
38 | #define REVISION_C4 0x5 | ||
39 | #define REVISION_XM_A 0x0 | ||
40 | #define REVISION_XM_B 0x1 | ||
41 | +#define REVISION_XM_C 0x2 | ||
42 | |||
43 | /* | ||
44 | * IEN - Input Enable | ||
45 | -- | ||
46 | 1.6.6.1 | ||
47 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0005-Add-support-for-SMSC95XX-USB-2.0-10-100MBit-Ethernet.patch b/recipes-bsp/u-boot/u-boot/2011.06/0005-Add-support-for-SMSC95XX-USB-2.0-10-100MBit-Ethernet.patch new file mode 100644 index 00000000..2c400d83 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0005-Add-support-for-SMSC95XX-USB-2.0-10-100MBit-Ethernet.patch | |||
@@ -0,0 +1,989 @@ | |||
1 | From 00b6a679e3c739567f1383030cd61483a15555f8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Simon Glass <sjg@chromium.org> | ||
3 | Date: Mon, 13 Jun 2011 13:13:09 +0000 | ||
4 | Subject: [PATCH 05/30] Add support for SMSC95XX USB 2.0 10/100MBit Ethernet Adapter | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | The SMSC95XX is a USB hub with a built-in Ethernet adapter. This adds support | ||
10 | for this, using the USB host network framework. | ||
11 | |||
12 | Changes for v2: | ||
13 | - Coding style cleanup | ||
14 | - Changed some comments as suggested | ||
15 | |||
16 | Changes for v3: | ||
17 | - Change turbo_mode to #define | ||
18 | |||
19 | Changes for v4: | ||
20 | - Dropped Tegra2 specific bit | ||
21 | - Fixed a few broken bits in SMSC from my testing | ||
22 | |||
23 | Changes for v5: | ||
24 | - Code style clean-ups in SMSC | ||
25 | - Cleaned up debugging of errors in SMSC driver | ||
26 | |||
27 | Changes for v6: | ||
28 | - Set NET_IP_ALIGN to 0 always | ||
29 | |||
30 | Changes for v8: | ||
31 | - Add setup of SMSC write_hwaddr function | ||
32 | |||
33 | Signed-off-by: Simon Glass <sjg@chromium.org> | ||
34 | Tested-by: Eric Bénard <eric@eukrea.com> | ||
35 | --- | ||
36 | drivers/usb/eth/Makefile | 1 + | ||
37 | drivers/usb/eth/smsc95xx.c | 879 +++++++++++++++++++++++++++++++++++++++++++ | ||
38 | drivers/usb/eth/usb_ether.c | 7 + | ||
39 | include/usb_ether.h | 13 + | ||
40 | 4 files changed, 900 insertions(+), 0 deletions(-) | ||
41 | create mode 100644 drivers/usb/eth/smsc95xx.c | ||
42 | |||
43 | diff --git a/drivers/usb/eth/Makefile b/drivers/usb/eth/Makefile | ||
44 | index 6a5f25a..e28793d 100644 | ||
45 | --- a/drivers/usb/eth/Makefile | ||
46 | +++ b/drivers/usb/eth/Makefile | ||
47 | @@ -28,6 +28,7 @@ COBJS-$(CONFIG_USB_HOST_ETHER) += usb_ether.o | ||
48 | ifdef CONFIG_USB_ETHER_ASIX | ||
49 | COBJS-y += asix.o | ||
50 | endif | ||
51 | +COBJS-$(CONFIG_USB_ETHER_SMSC95XX) += smsc95xx.o | ||
52 | |||
53 | COBJS := $(COBJS-y) | ||
54 | SRCS := $(COBJS:.o=.c) | ||
55 | diff --git a/drivers/usb/eth/smsc95xx.c b/drivers/usb/eth/smsc95xx.c | ||
56 | new file mode 100644 | ||
57 | index 0000000..97f2729 | ||
58 | --- /dev/null | ||
59 | +++ b/drivers/usb/eth/smsc95xx.c | ||
60 | @@ -0,0 +1,879 @@ | ||
61 | +/* | ||
62 | + * Copyright (c) 2011 The Chromium OS Authors. | ||
63 | + * Copyright (C) 2009 NVIDIA, Corporation | ||
64 | + * See file CREDITS for list of people who contributed to this | ||
65 | + * project. | ||
66 | + * | ||
67 | + * This program is free software; you can redistribute it and/or | ||
68 | + * modify it under the terms of the GNU General Public License as | ||
69 | + * published by the Free Software Foundation; either version 2 of | ||
70 | + * the License, or (at your option) any later version. | ||
71 | + * | ||
72 | + * This program is distributed in the hope that it will be useful, | ||
73 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
74 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
75 | + * GNU General Public License for more details. | ||
76 | + * | ||
77 | + * You should have received a copy of the GNU General Public License | ||
78 | + * along with this program; if not, write to the Free Software | ||
79 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
80 | + * MA 02111-1307 USA | ||
81 | + */ | ||
82 | + | ||
83 | +#include <common.h> | ||
84 | +#include <usb.h> | ||
85 | +#include <linux/mii.h> | ||
86 | +#include "usb_ether.h" | ||
87 | + | ||
88 | +/* SMSC LAN95xx based USB 2.0 Ethernet Devices */ | ||
89 | + | ||
90 | +/* Tx command words */ | ||
91 | +#define TX_CMD_A_FIRST_SEG_ 0x00002000 | ||
92 | +#define TX_CMD_A_LAST_SEG_ 0x00001000 | ||
93 | + | ||
94 | +/* Rx status word */ | ||
95 | +#define RX_STS_FL_ 0x3FFF0000 /* Frame Length */ | ||
96 | +#define RX_STS_ES_ 0x00008000 /* Error Summary */ | ||
97 | + | ||
98 | +/* SCSRs */ | ||
99 | +#define ID_REV 0x00 | ||
100 | + | ||
101 | +#define INT_STS 0x08 | ||
102 | + | ||
103 | +#define TX_CFG 0x10 | ||
104 | +#define TX_CFG_ON_ 0x00000004 | ||
105 | + | ||
106 | +#define HW_CFG 0x14 | ||
107 | +#define HW_CFG_BIR_ 0x00001000 | ||
108 | +#define HW_CFG_RXDOFF_ 0x00000600 | ||
109 | +#define HW_CFG_MEF_ 0x00000020 | ||
110 | +#define HW_CFG_BCE_ 0x00000002 | ||
111 | +#define HW_CFG_LRST_ 0x00000008 | ||
112 | + | ||
113 | +#define PM_CTRL 0x20 | ||
114 | +#define PM_CTL_PHY_RST_ 0x00000010 | ||
115 | + | ||
116 | +#define AFC_CFG 0x2C | ||
117 | + | ||
118 | +/* | ||
119 | + * Hi watermark = 15.5Kb (~10 mtu pkts) | ||
120 | + * low watermark = 3k (~2 mtu pkts) | ||
121 | + * backpressure duration = ~ 350us | ||
122 | + * Apply FC on any frame. | ||
123 | + */ | ||
124 | +#define AFC_CFG_DEFAULT 0x00F830A1 | ||
125 | + | ||
126 | +#define E2P_CMD 0x30 | ||
127 | +#define E2P_CMD_BUSY_ 0x80000000 | ||
128 | +#define E2P_CMD_READ_ 0x00000000 | ||
129 | +#define E2P_CMD_TIMEOUT_ 0x00000400 | ||
130 | +#define E2P_CMD_LOADED_ 0x00000200 | ||
131 | +#define E2P_CMD_ADDR_ 0x000001FF | ||
132 | + | ||
133 | +#define E2P_DATA 0x34 | ||
134 | + | ||
135 | +#define BURST_CAP 0x38 | ||
136 | + | ||
137 | +#define INT_EP_CTL 0x68 | ||
138 | +#define INT_EP_CTL_PHY_INT_ 0x00008000 | ||
139 | + | ||
140 | +#define BULK_IN_DLY 0x6C | ||
141 | + | ||
142 | +/* MAC CSRs */ | ||
143 | +#define MAC_CR 0x100 | ||
144 | +#define MAC_CR_MCPAS_ 0x00080000 | ||
145 | +#define MAC_CR_PRMS_ 0x00040000 | ||
146 | +#define MAC_CR_HPFILT_ 0x00002000 | ||
147 | +#define MAC_CR_TXEN_ 0x00000008 | ||
148 | +#define MAC_CR_RXEN_ 0x00000004 | ||
149 | + | ||
150 | +#define ADDRH 0x104 | ||
151 | + | ||
152 | +#define ADDRL 0x108 | ||
153 | + | ||
154 | +#define MII_ADDR 0x114 | ||
155 | +#define MII_WRITE_ 0x02 | ||
156 | +#define MII_BUSY_ 0x01 | ||
157 | +#define MII_READ_ 0x00 /* ~of MII Write bit */ | ||
158 | + | ||
159 | +#define MII_DATA 0x118 | ||
160 | + | ||
161 | +#define FLOW 0x11C | ||
162 | + | ||
163 | +#define VLAN1 0x120 | ||
164 | + | ||
165 | +#define COE_CR 0x130 | ||
166 | +#define Tx_COE_EN_ 0x00010000 | ||
167 | +#define Rx_COE_EN_ 0x00000001 | ||
168 | + | ||
169 | +/* Vendor-specific PHY Definitions */ | ||
170 | +#define PHY_INT_SRC 29 | ||
171 | + | ||
172 | +#define PHY_INT_MASK 30 | ||
173 | +#define PHY_INT_MASK_ANEG_COMP_ ((u16)0x0040) | ||
174 | +#define PHY_INT_MASK_LINK_DOWN_ ((u16)0x0010) | ||
175 | +#define PHY_INT_MASK_DEFAULT_ (PHY_INT_MASK_ANEG_COMP_ | \ | ||
176 | + PHY_INT_MASK_LINK_DOWN_) | ||
177 | + | ||
178 | +/* USB Vendor Requests */ | ||
179 | +#define USB_VENDOR_REQUEST_WRITE_REGISTER 0xA0 | ||
180 | +#define USB_VENDOR_REQUEST_READ_REGISTER 0xA1 | ||
181 | + | ||
182 | +/* Some extra defines */ | ||
183 | +#define HS_USB_PKT_SIZE 512 | ||
184 | +#define FS_USB_PKT_SIZE 64 | ||
185 | +#define DEFAULT_HS_BURST_CAP_SIZE (16 * 1024 + 5 * HS_USB_PKT_SIZE) | ||
186 | +#define DEFAULT_FS_BURST_CAP_SIZE (6 * 1024 + 33 * FS_USB_PKT_SIZE) | ||
187 | +#define DEFAULT_BULK_IN_DELAY 0x00002000 | ||
188 | +#define MAX_SINGLE_PACKET_SIZE 2048 | ||
189 | +#define EEPROM_MAC_OFFSET 0x01 | ||
190 | +#define SMSC95XX_INTERNAL_PHY_ID 1 | ||
191 | +#define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */ | ||
192 | + | ||
193 | +/* local defines */ | ||
194 | +#define SMSC95XX_BASE_NAME "sms" | ||
195 | +#define USB_CTRL_SET_TIMEOUT 5000 | ||
196 | +#define USB_CTRL_GET_TIMEOUT 5000 | ||
197 | +#define USB_BULK_SEND_TIMEOUT 5000 | ||
198 | +#define USB_BULK_RECV_TIMEOUT 5000 | ||
199 | + | ||
200 | +#define AX_RX_URB_SIZE 2048 | ||
201 | +#define PHY_CONNECT_TIMEOUT 5000 | ||
202 | + | ||
203 | +#define TURBO_MODE | ||
204 | + | ||
205 | +/* local vars */ | ||
206 | +static int curr_eth_dev; /* index for name of next device detected */ | ||
207 | + | ||
208 | + | ||
209 | +/* | ||
210 | + * Smsc95xx infrastructure commands | ||
211 | + */ | ||
212 | +static int smsc95xx_write_reg(struct ueth_data *dev, u32 index, u32 data) | ||
213 | +{ | ||
214 | + int len; | ||
215 | + | ||
216 | + cpu_to_le32s(&data); | ||
217 | + | ||
218 | + len = usb_control_msg(dev->pusb_dev, usb_sndctrlpipe(dev->pusb_dev, 0), | ||
219 | + USB_VENDOR_REQUEST_WRITE_REGISTER, | ||
220 | + USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | ||
221 | + 00, index, &data, sizeof(data), USB_CTRL_SET_TIMEOUT); | ||
222 | + if (len != sizeof(data)) { | ||
223 | + debug("smsc95xx_write_reg failed: index=%d, data=%d, len=%d", | ||
224 | + index, data, len); | ||
225 | + return -1; | ||
226 | + } | ||
227 | + return 0; | ||
228 | +} | ||
229 | + | ||
230 | +static int smsc95xx_read_reg(struct ueth_data *dev, u32 index, u32 *data) | ||
231 | +{ | ||
232 | + int len; | ||
233 | + | ||
234 | + len = usb_control_msg(dev->pusb_dev, usb_rcvctrlpipe(dev->pusb_dev, 0), | ||
235 | + USB_VENDOR_REQUEST_READ_REGISTER, | ||
236 | + USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | ||
237 | + 00, index, data, sizeof(data), USB_CTRL_GET_TIMEOUT); | ||
238 | + if (len != sizeof(data)) { | ||
239 | + debug("smsc95xx_read_reg failed: index=%d, len=%d", | ||
240 | + index, len); | ||
241 | + return -1; | ||
242 | + } | ||
243 | + | ||
244 | + le32_to_cpus(data); | ||
245 | + return 0; | ||
246 | +} | ||
247 | + | ||
248 | +/* Loop until the read is completed with timeout */ | ||
249 | +static int smsc95xx_phy_wait_not_busy(struct ueth_data *dev) | ||
250 | +{ | ||
251 | + unsigned long start_time = get_timer(0); | ||
252 | + u32 val; | ||
253 | + | ||
254 | + do { | ||
255 | + smsc95xx_read_reg(dev, MII_ADDR, &val); | ||
256 | + if (!(val & MII_BUSY_)) | ||
257 | + return 0; | ||
258 | + } while (get_timer(start_time) < 1 * 1000 * 1000); | ||
259 | + | ||
260 | + return -1; | ||
261 | +} | ||
262 | + | ||
263 | +static int smsc95xx_mdio_read(struct ueth_data *dev, int phy_id, int idx) | ||
264 | +{ | ||
265 | + u32 val, addr; | ||
266 | + | ||
267 | + /* confirm MII not busy */ | ||
268 | + if (smsc95xx_phy_wait_not_busy(dev)) { | ||
269 | + debug("MII is busy in smsc95xx_mdio_read\n"); | ||
270 | + return -1; | ||
271 | + } | ||
272 | + | ||
273 | + /* set the address, index & direction (read from PHY) */ | ||
274 | + addr = (phy_id << 11) | (idx << 6) | MII_READ_; | ||
275 | + smsc95xx_write_reg(dev, MII_ADDR, addr); | ||
276 | + | ||
277 | + if (smsc95xx_phy_wait_not_busy(dev)) { | ||
278 | + debug("Timed out reading MII reg %02X\n", idx); | ||
279 | + return -1; | ||
280 | + } | ||
281 | + | ||
282 | + smsc95xx_read_reg(dev, MII_DATA, &val); | ||
283 | + | ||
284 | + return (u16)(val & 0xFFFF); | ||
285 | +} | ||
286 | + | ||
287 | +static void smsc95xx_mdio_write(struct ueth_data *dev, int phy_id, int idx, | ||
288 | + int regval) | ||
289 | +{ | ||
290 | + u32 val, addr; | ||
291 | + | ||
292 | + /* confirm MII not busy */ | ||
293 | + if (smsc95xx_phy_wait_not_busy(dev)) { | ||
294 | + debug("MII is busy in smsc95xx_mdio_write\n"); | ||
295 | + return; | ||
296 | + } | ||
297 | + | ||
298 | + val = regval; | ||
299 | + smsc95xx_write_reg(dev, MII_DATA, val); | ||
300 | + | ||
301 | + /* set the address, index & direction (write to PHY) */ | ||
302 | + addr = (phy_id << 11) | (idx << 6) | MII_WRITE_; | ||
303 | + smsc95xx_write_reg(dev, MII_ADDR, addr); | ||
304 | + | ||
305 | + if (smsc95xx_phy_wait_not_busy(dev)) | ||
306 | + debug("Timed out writing MII reg %02X\n", idx); | ||
307 | +} | ||
308 | + | ||
309 | +static int smsc95xx_eeprom_confirm_not_busy(struct ueth_data *dev) | ||
310 | +{ | ||
311 | + unsigned long start_time = get_timer(0); | ||
312 | + u32 val; | ||
313 | + | ||
314 | + do { | ||
315 | + smsc95xx_read_reg(dev, E2P_CMD, &val); | ||
316 | + if (!(val & E2P_CMD_LOADED_)) { | ||
317 | + debug("No EEPROM present\n"); | ||
318 | + return -1; | ||
319 | + } | ||
320 | + if (!(val & E2P_CMD_BUSY_)) | ||
321 | + return 0; | ||
322 | + udelay(40); | ||
323 | + } while (get_timer(start_time) < 1 * 1000 * 1000); | ||
324 | + | ||
325 | + debug("EEPROM is busy\n"); | ||
326 | + return -1; | ||
327 | +} | ||
328 | + | ||
329 | +static int smsc95xx_wait_eeprom(struct ueth_data *dev) | ||
330 | +{ | ||
331 | + unsigned long start_time = get_timer(0); | ||
332 | + u32 val; | ||
333 | + | ||
334 | + do { | ||
335 | + smsc95xx_read_reg(dev, E2P_CMD, &val); | ||
336 | + if (!(val & E2P_CMD_BUSY_) || (val & E2P_CMD_TIMEOUT_)) | ||
337 | + break; | ||
338 | + udelay(40); | ||
339 | + } while (get_timer(start_time) < 1 * 1000 * 1000); | ||
340 | + | ||
341 | + if (val & (E2P_CMD_TIMEOUT_ | E2P_CMD_BUSY_)) { | ||
342 | + debug("EEPROM read operation timeout\n"); | ||
343 | + return -1; | ||
344 | + } | ||
345 | + return 0; | ||
346 | +} | ||
347 | + | ||
348 | +static int smsc95xx_read_eeprom(struct ueth_data *dev, u32 offset, u32 length, | ||
349 | + u8 *data) | ||
350 | +{ | ||
351 | + u32 val; | ||
352 | + int i, ret; | ||
353 | + | ||
354 | + ret = smsc95xx_eeprom_confirm_not_busy(dev); | ||
355 | + if (ret) | ||
356 | + return ret; | ||
357 | + | ||
358 | + for (i = 0; i < length; i++) { | ||
359 | + val = E2P_CMD_BUSY_ | E2P_CMD_READ_ | (offset & E2P_CMD_ADDR_); | ||
360 | + smsc95xx_write_reg(dev, E2P_CMD, val); | ||
361 | + | ||
362 | + ret = smsc95xx_wait_eeprom(dev); | ||
363 | + if (ret < 0) | ||
364 | + return ret; | ||
365 | + | ||
366 | + smsc95xx_read_reg(dev, E2P_DATA, &val); | ||
367 | + data[i] = val & 0xFF; | ||
368 | + offset++; | ||
369 | + } | ||
370 | + return 0; | ||
371 | +} | ||
372 | + | ||
373 | +/* | ||
374 | + * mii_nway_restart - restart NWay (autonegotiation) for this interface | ||
375 | + * | ||
376 | + * Returns 0 on success, negative on error. | ||
377 | + */ | ||
378 | +static int mii_nway_restart(struct ueth_data *dev) | ||
379 | +{ | ||
380 | + int bmcr; | ||
381 | + int r = -1; | ||
382 | + | ||
383 | + /* if autoneg is off, it's an error */ | ||
384 | + bmcr = smsc95xx_mdio_read(dev, dev->phy_id, MII_BMCR); | ||
385 | + | ||
386 | + if (bmcr & BMCR_ANENABLE) { | ||
387 | + bmcr |= BMCR_ANRESTART; | ||
388 | + smsc95xx_mdio_write(dev, dev->phy_id, MII_BMCR, bmcr); | ||
389 | + r = 0; | ||
390 | + } | ||
391 | + return r; | ||
392 | +} | ||
393 | + | ||
394 | +static int smsc95xx_phy_initialize(struct ueth_data *dev) | ||
395 | +{ | ||
396 | + smsc95xx_mdio_write(dev, dev->phy_id, MII_BMCR, BMCR_RESET); | ||
397 | + smsc95xx_mdio_write(dev, dev->phy_id, MII_ADVERTISE, | ||
398 | + ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP | | ||
399 | + ADVERTISE_PAUSE_ASYM); | ||
400 | + | ||
401 | + /* read to clear */ | ||
402 | + smsc95xx_mdio_read(dev, dev->phy_id, PHY_INT_SRC); | ||
403 | + | ||
404 | + smsc95xx_mdio_write(dev, dev->phy_id, PHY_INT_MASK, | ||
405 | + PHY_INT_MASK_DEFAULT_); | ||
406 | + mii_nway_restart(dev); | ||
407 | + | ||
408 | + debug("phy initialised succesfully\n"); | ||
409 | + return 0; | ||
410 | +} | ||
411 | + | ||
412 | +static int smsc95xx_init_mac_address(struct eth_device *eth, | ||
413 | + struct ueth_data *dev) | ||
414 | +{ | ||
415 | + /* try reading mac address from EEPROM */ | ||
416 | + if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, | ||
417 | + eth->enetaddr) == 0) { | ||
418 | + if (is_valid_ether_addr(eth->enetaddr)) { | ||
419 | + /* eeprom values are valid so use them */ | ||
420 | + debug("MAC address read from EEPROM\n"); | ||
421 | + return 0; | ||
422 | + } | ||
423 | + } | ||
424 | + | ||
425 | + /* | ||
426 | + * No eeprom, or eeprom values are invalid. Generating a random MAC | ||
427 | + * address is not safe. Just return an error. | ||
428 | + */ | ||
429 | + return -1; | ||
430 | +} | ||
431 | + | ||
432 | +static int smsc95xx_write_hwaddr(struct eth_device *eth) | ||
433 | +{ | ||
434 | + struct ueth_data *dev = (struct ueth_data *)eth->priv; | ||
435 | + u32 addr_lo, addr_hi; | ||
436 | + int ret; | ||
437 | + | ||
438 | + /* set hardware address */ | ||
439 | + debug("** %s()\n", __func__); | ||
440 | + addr_lo = cpu_to_le32(*((u32 *)eth->enetaddr)); | ||
441 | + addr_hi = cpu_to_le16(*((u16 *)(eth->enetaddr + 4))); | ||
442 | + ret = smsc95xx_write_reg(dev, ADDRL, addr_lo); | ||
443 | + if (ret < 0) { | ||
444 | + debug("Failed to write ADDRL: %d\n", ret); | ||
445 | + return ret; | ||
446 | + } | ||
447 | + | ||
448 | + ret = smsc95xx_write_reg(dev, ADDRH, addr_hi); | ||
449 | + if (ret < 0) | ||
450 | + return ret; | ||
451 | + debug("MAC %02x:%02x:%02x:%02x:%02x:%02x\n", | ||
452 | + eth->enetaddr[0], eth->enetaddr[1], | ||
453 | + eth->enetaddr[2], eth->enetaddr[3], | ||
454 | + eth->enetaddr[4], eth->enetaddr[5]); | ||
455 | + dev->have_hwaddr = 1; | ||
456 | + return 0; | ||
457 | +} | ||
458 | + | ||
459 | +/* Enable or disable Tx & Rx checksum offload engines */ | ||
460 | +static int smsc95xx_set_csums(struct ueth_data *dev, | ||
461 | + int use_tx_csum, int use_rx_csum) | ||
462 | +{ | ||
463 | + u32 read_buf; | ||
464 | + int ret = smsc95xx_read_reg(dev, COE_CR, &read_buf); | ||
465 | + if (ret < 0) | ||
466 | + return ret; | ||
467 | + | ||
468 | + if (use_tx_csum) | ||
469 | + read_buf |= Tx_COE_EN_; | ||
470 | + else | ||
471 | + read_buf &= ~Tx_COE_EN_; | ||
472 | + | ||
473 | + if (use_rx_csum) | ||
474 | + read_buf |= Rx_COE_EN_; | ||
475 | + else | ||
476 | + read_buf &= ~Rx_COE_EN_; | ||
477 | + | ||
478 | + ret = smsc95xx_write_reg(dev, COE_CR, read_buf); | ||
479 | + if (ret < 0) | ||
480 | + return ret; | ||
481 | + | ||
482 | + debug("COE_CR = 0x%08x\n", read_buf); | ||
483 | + return 0; | ||
484 | +} | ||
485 | + | ||
486 | +static void smsc95xx_set_multicast(struct ueth_data *dev) | ||
487 | +{ | ||
488 | + /* No multicast in u-boot */ | ||
489 | + dev->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_MCPAS_ | MAC_CR_HPFILT_); | ||
490 | +} | ||
491 | + | ||
492 | +/* starts the TX path */ | ||
493 | +static void smsc95xx_start_tx_path(struct ueth_data *dev) | ||
494 | +{ | ||
495 | + u32 reg_val; | ||
496 | + | ||
497 | + /* Enable Tx at MAC */ | ||
498 | + dev->mac_cr |= MAC_CR_TXEN_; | ||
499 | + | ||
500 | + smsc95xx_write_reg(dev, MAC_CR, dev->mac_cr); | ||
501 | + | ||
502 | + /* Enable Tx at SCSRs */ | ||
503 | + reg_val = TX_CFG_ON_; | ||
504 | + smsc95xx_write_reg(dev, TX_CFG, reg_val); | ||
505 | +} | ||
506 | + | ||
507 | +/* Starts the Receive path */ | ||
508 | +static void smsc95xx_start_rx_path(struct ueth_data *dev) | ||
509 | +{ | ||
510 | + dev->mac_cr |= MAC_CR_RXEN_; | ||
511 | + smsc95xx_write_reg(dev, MAC_CR, dev->mac_cr); | ||
512 | +} | ||
513 | + | ||
514 | +/* | ||
515 | + * Smsc95xx callbacks | ||
516 | + */ | ||
517 | +static int smsc95xx_init(struct eth_device *eth, bd_t *bd) | ||
518 | +{ | ||
519 | + int ret; | ||
520 | + u32 write_buf; | ||
521 | + u32 read_buf; | ||
522 | + u32 burst_cap; | ||
523 | + int timeout; | ||
524 | + struct ueth_data *dev = (struct ueth_data *)eth->priv; | ||
525 | +#define TIMEOUT_RESOLUTION 50 /* ms */ | ||
526 | + int link_detected; | ||
527 | + | ||
528 | + debug("** %s()\n", __func__); | ||
529 | + dev->phy_id = SMSC95XX_INTERNAL_PHY_ID; /* fixed phy id */ | ||
530 | + | ||
531 | + write_buf = HW_CFG_LRST_; | ||
532 | + ret = smsc95xx_write_reg(dev, HW_CFG, write_buf); | ||
533 | + if (ret < 0) | ||
534 | + return ret; | ||
535 | + | ||
536 | + timeout = 0; | ||
537 | + do { | ||
538 | + ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); | ||
539 | + if (ret < 0) | ||
540 | + return ret; | ||
541 | + udelay(10 * 1000); | ||
542 | + timeout++; | ||
543 | + } while ((read_buf & HW_CFG_LRST_) && (timeout < 100)); | ||
544 | + | ||
545 | + if (timeout >= 100) { | ||
546 | + debug("timeout waiting for completion of Lite Reset\n"); | ||
547 | + return -1; | ||
548 | + } | ||
549 | + | ||
550 | + write_buf = PM_CTL_PHY_RST_; | ||
551 | + ret = smsc95xx_write_reg(dev, PM_CTRL, write_buf); | ||
552 | + if (ret < 0) | ||
553 | + return ret; | ||
554 | + | ||
555 | + timeout = 0; | ||
556 | + do { | ||
557 | + ret = smsc95xx_read_reg(dev, PM_CTRL, &read_buf); | ||
558 | + if (ret < 0) | ||
559 | + return ret; | ||
560 | + udelay(10 * 1000); | ||
561 | + timeout++; | ||
562 | + } while ((read_buf & PM_CTL_PHY_RST_) && (timeout < 100)); | ||
563 | + if (timeout >= 100) { | ||
564 | + debug("timeout waiting for PHY Reset\n"); | ||
565 | + return -1; | ||
566 | + } | ||
567 | + if (!dev->have_hwaddr && smsc95xx_init_mac_address(eth, dev) == 0) | ||
568 | + dev->have_hwaddr = 1; | ||
569 | + if (!dev->have_hwaddr) { | ||
570 | + puts("Error: SMSC95xx: No MAC address set - set usbethaddr\n"); | ||
571 | + return -1; | ||
572 | + } | ||
573 | + if (smsc95xx_write_hwaddr(eth) < 0) | ||
574 | + return -1; | ||
575 | + | ||
576 | + ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); | ||
577 | + if (ret < 0) | ||
578 | + return ret; | ||
579 | + debug("Read Value from HW_CFG : 0x%08x\n", read_buf); | ||
580 | + | ||
581 | + read_buf |= HW_CFG_BIR_; | ||
582 | + ret = smsc95xx_write_reg(dev, HW_CFG, read_buf); | ||
583 | + if (ret < 0) | ||
584 | + return ret; | ||
585 | + | ||
586 | + ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); | ||
587 | + if (ret < 0) | ||
588 | + return ret; | ||
589 | + debug("Read Value from HW_CFG after writing " | ||
590 | + "HW_CFG_BIR_: 0x%08x\n", read_buf); | ||
591 | + | ||
592 | +#ifdef TURBO_MODE | ||
593 | + if (dev->pusb_dev->speed == USB_SPEED_HIGH) { | ||
594 | + burst_cap = DEFAULT_HS_BURST_CAP_SIZE / HS_USB_PKT_SIZE; | ||
595 | + dev->rx_urb_size = DEFAULT_HS_BURST_CAP_SIZE; | ||
596 | + } else { | ||
597 | + burst_cap = DEFAULT_FS_BURST_CAP_SIZE / FS_USB_PKT_SIZE; | ||
598 | + dev->rx_urb_size = DEFAULT_FS_BURST_CAP_SIZE; | ||
599 | + } | ||
600 | +#else | ||
601 | + burst_cap = 0; | ||
602 | + dev->rx_urb_size = MAX_SINGLE_PACKET_SIZE; | ||
603 | +#endif | ||
604 | + debug("rx_urb_size=%ld\n", (ulong)dev->rx_urb_size); | ||
605 | + | ||
606 | + ret = smsc95xx_write_reg(dev, BURST_CAP, burst_cap); | ||
607 | + if (ret < 0) | ||
608 | + return ret; | ||
609 | + | ||
610 | + ret = smsc95xx_read_reg(dev, BURST_CAP, &read_buf); | ||
611 | + if (ret < 0) | ||
612 | + return ret; | ||
613 | + debug("Read Value from BURST_CAP after writing: 0x%08x\n", read_buf); | ||
614 | + | ||
615 | + read_buf = DEFAULT_BULK_IN_DELAY; | ||
616 | + ret = smsc95xx_write_reg(dev, BULK_IN_DLY, read_buf); | ||
617 | + if (ret < 0) | ||
618 | + return ret; | ||
619 | + | ||
620 | + ret = smsc95xx_read_reg(dev, BULK_IN_DLY, &read_buf); | ||
621 | + if (ret < 0) | ||
622 | + return ret; | ||
623 | + debug("Read Value from BULK_IN_DLY after writing: " | ||
624 | + "0x%08x\n", read_buf); | ||
625 | + | ||
626 | + ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); | ||
627 | + if (ret < 0) | ||
628 | + return ret; | ||
629 | + debug("Read Value from HW_CFG: 0x%08x\n", read_buf); | ||
630 | + | ||
631 | +#ifdef TURBO_MODE | ||
632 | + read_buf |= (HW_CFG_MEF_ | HW_CFG_BCE_); | ||
633 | +#endif | ||
634 | + read_buf &= ~HW_CFG_RXDOFF_; | ||
635 | + | ||
636 | +#define NET_IP_ALIGN 0 | ||
637 | + read_buf |= NET_IP_ALIGN << 9; | ||
638 | + | ||
639 | + ret = smsc95xx_write_reg(dev, HW_CFG, read_buf); | ||
640 | + if (ret < 0) | ||
641 | + return ret; | ||
642 | + | ||
643 | + ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); | ||
644 | + if (ret < 0) | ||
645 | + return ret; | ||
646 | + debug("Read Value from HW_CFG after writing: 0x%08x\n", read_buf); | ||
647 | + | ||
648 | + write_buf = 0xFFFFFFFF; | ||
649 | + ret = smsc95xx_write_reg(dev, INT_STS, write_buf); | ||
650 | + if (ret < 0) | ||
651 | + return ret; | ||
652 | + | ||
653 | + ret = smsc95xx_read_reg(dev, ID_REV, &read_buf); | ||
654 | + if (ret < 0) | ||
655 | + return ret; | ||
656 | + debug("ID_REV = 0x%08x\n", read_buf); | ||
657 | + | ||
658 | + /* Init Tx */ | ||
659 | + write_buf = 0; | ||
660 | + ret = smsc95xx_write_reg(dev, FLOW, write_buf); | ||
661 | + if (ret < 0) | ||
662 | + return ret; | ||
663 | + | ||
664 | + read_buf = AFC_CFG_DEFAULT; | ||
665 | + ret = smsc95xx_write_reg(dev, AFC_CFG, read_buf); | ||
666 | + if (ret < 0) | ||
667 | + return ret; | ||
668 | + | ||
669 | + ret = smsc95xx_read_reg(dev, MAC_CR, &dev->mac_cr); | ||
670 | + if (ret < 0) | ||
671 | + return ret; | ||
672 | + | ||
673 | + /* Init Rx. Set Vlan */ | ||
674 | + write_buf = (u32)ETH_P_8021Q; | ||
675 | + ret = smsc95xx_write_reg(dev, VLAN1, write_buf); | ||
676 | + if (ret < 0) | ||
677 | + return ret; | ||
678 | + | ||
679 | + /* Disable checksum offload engines */ | ||
680 | + ret = smsc95xx_set_csums(dev, 0, 0); | ||
681 | + if (ret < 0) { | ||
682 | + debug("Failed to set csum offload: %d\n", ret); | ||
683 | + return ret; | ||
684 | + } | ||
685 | + smsc95xx_set_multicast(dev); | ||
686 | + | ||
687 | + if (smsc95xx_phy_initialize(dev) < 0) | ||
688 | + return -1; | ||
689 | + ret = smsc95xx_read_reg(dev, INT_EP_CTL, &read_buf); | ||
690 | + if (ret < 0) | ||
691 | + return ret; | ||
692 | + | ||
693 | + /* enable PHY interrupts */ | ||
694 | + read_buf |= INT_EP_CTL_PHY_INT_; | ||
695 | + | ||
696 | + ret = smsc95xx_write_reg(dev, INT_EP_CTL, read_buf); | ||
697 | + if (ret < 0) | ||
698 | + return ret; | ||
699 | + | ||
700 | + smsc95xx_start_tx_path(dev); | ||
701 | + smsc95xx_start_rx_path(dev); | ||
702 | + | ||
703 | + timeout = 0; | ||
704 | + do { | ||
705 | + link_detected = smsc95xx_mdio_read(dev, dev->phy_id, MII_BMSR) | ||
706 | + & BMSR_LSTATUS; | ||
707 | + if (!link_detected) { | ||
708 | + if (timeout == 0) | ||
709 | + printf("Waiting for Ethernet connection... "); | ||
710 | + udelay(TIMEOUT_RESOLUTION * 1000); | ||
711 | + timeout += TIMEOUT_RESOLUTION; | ||
712 | + } | ||
713 | + } while (!link_detected && timeout < PHY_CONNECT_TIMEOUT); | ||
714 | + if (link_detected) { | ||
715 | + if (timeout != 0) | ||
716 | + printf("done.\n"); | ||
717 | + } else { | ||
718 | + printf("unable to connect.\n"); | ||
719 | + return -1; | ||
720 | + } | ||
721 | + return 0; | ||
722 | +} | ||
723 | + | ||
724 | +static int smsc95xx_send(struct eth_device *eth, volatile void* packet, | ||
725 | + int length) | ||
726 | +{ | ||
727 | + struct ueth_data *dev = (struct ueth_data *)eth->priv; | ||
728 | + int err; | ||
729 | + int actual_len; | ||
730 | + u32 tx_cmd_a; | ||
731 | + u32 tx_cmd_b; | ||
732 | + unsigned char msg[PKTSIZE + sizeof(tx_cmd_a) + sizeof(tx_cmd_b)]; | ||
733 | + | ||
734 | + debug("** %s(), len %d, buf %#x\n", __func__, length, (int)msg); | ||
735 | + if (length > PKTSIZE) | ||
736 | + return -1; | ||
737 | + | ||
738 | + tx_cmd_a = (u32)length | TX_CMD_A_FIRST_SEG_ | TX_CMD_A_LAST_SEG_; | ||
739 | + tx_cmd_b = (u32)length; | ||
740 | + cpu_to_le32s(&tx_cmd_a); | ||
741 | + cpu_to_le32s(&tx_cmd_b); | ||
742 | + | ||
743 | + /* prepend cmd_a and cmd_b */ | ||
744 | + memcpy(msg, &tx_cmd_a, sizeof(tx_cmd_a)); | ||
745 | + memcpy(msg + sizeof(tx_cmd_a), &tx_cmd_b, sizeof(tx_cmd_b)); | ||
746 | + memcpy(msg + sizeof(tx_cmd_a) + sizeof(tx_cmd_b), (void *)packet, | ||
747 | + length); | ||
748 | + err = usb_bulk_msg(dev->pusb_dev, | ||
749 | + usb_sndbulkpipe(dev->pusb_dev, dev->ep_out), | ||
750 | + (void *)msg, | ||
751 | + length + sizeof(tx_cmd_a) + sizeof(tx_cmd_b), | ||
752 | + &actual_len, | ||
753 | + USB_BULK_SEND_TIMEOUT); | ||
754 | + debug("Tx: len = %u, actual = %u, err = %d\n", | ||
755 | + length + sizeof(tx_cmd_a) + sizeof(tx_cmd_b), | ||
756 | + actual_len, err); | ||
757 | + return err; | ||
758 | +} | ||
759 | + | ||
760 | +static int smsc95xx_recv(struct eth_device *eth) | ||
761 | +{ | ||
762 | + struct ueth_data *dev = (struct ueth_data *)eth->priv; | ||
763 | + static unsigned char recv_buf[AX_RX_URB_SIZE]; | ||
764 | + unsigned char *buf_ptr; | ||
765 | + int err; | ||
766 | + int actual_len; | ||
767 | + u32 packet_len; | ||
768 | + int cur_buf_align; | ||
769 | + | ||
770 | + debug("** %s()\n", __func__); | ||
771 | + err = usb_bulk_msg(dev->pusb_dev, | ||
772 | + usb_rcvbulkpipe(dev->pusb_dev, dev->ep_in), | ||
773 | + (void *)recv_buf, | ||
774 | + AX_RX_URB_SIZE, | ||
775 | + &actual_len, | ||
776 | + USB_BULK_RECV_TIMEOUT); | ||
777 | + debug("Rx: len = %u, actual = %u, err = %d\n", AX_RX_URB_SIZE, | ||
778 | + actual_len, err); | ||
779 | + if (err != 0) { | ||
780 | + debug("Rx: failed to receive\n"); | ||
781 | + return -1; | ||
782 | + } | ||
783 | + if (actual_len > AX_RX_URB_SIZE) { | ||
784 | + debug("Rx: received too many bytes %d\n", actual_len); | ||
785 | + return -1; | ||
786 | + } | ||
787 | + | ||
788 | + buf_ptr = recv_buf; | ||
789 | + while (actual_len > 0) { | ||
790 | + /* | ||
791 | + * 1st 4 bytes contain the length of the actual data plus error | ||
792 | + * info. Extract data length. | ||
793 | + */ | ||
794 | + if (actual_len < sizeof(packet_len)) { | ||
795 | + debug("Rx: incomplete packet length\n"); | ||
796 | + return -1; | ||
797 | + } | ||
798 | + memcpy(&packet_len, buf_ptr, sizeof(packet_len)); | ||
799 | + le32_to_cpus(&packet_len); | ||
800 | + if (packet_len & RX_STS_ES_) { | ||
801 | + debug("Rx: Error header=%#x", packet_len); | ||
802 | + return -1; | ||
803 | + } | ||
804 | + packet_len = ((packet_len & RX_STS_FL_) >> 16); | ||
805 | + | ||
806 | + if (packet_len > actual_len - sizeof(packet_len)) { | ||
807 | + debug("Rx: too large packet: %d\n", packet_len); | ||
808 | + return -1; | ||
809 | + } | ||
810 | + | ||
811 | + /* Notify net stack */ | ||
812 | + NetReceive(buf_ptr + sizeof(packet_len), packet_len - 4); | ||
813 | + | ||
814 | + /* Adjust for next iteration */ | ||
815 | + actual_len -= sizeof(packet_len) + packet_len; | ||
816 | + buf_ptr += sizeof(packet_len) + packet_len; | ||
817 | + cur_buf_align = (int)buf_ptr - (int)recv_buf; | ||
818 | + | ||
819 | + if (cur_buf_align & 0x03) { | ||
820 | + int align = 4 - (cur_buf_align & 0x03); | ||
821 | + | ||
822 | + actual_len -= align; | ||
823 | + buf_ptr += align; | ||
824 | + } | ||
825 | + } | ||
826 | + return err; | ||
827 | +} | ||
828 | + | ||
829 | +static void smsc95xx_halt(struct eth_device *eth) | ||
830 | +{ | ||
831 | + debug("** %s()\n", __func__); | ||
832 | +} | ||
833 | + | ||
834 | +/* | ||
835 | + * SMSC probing functions | ||
836 | + */ | ||
837 | +void smsc95xx_eth_before_probe(void) | ||
838 | +{ | ||
839 | + curr_eth_dev = 0; | ||
840 | +} | ||
841 | + | ||
842 | +struct smsc95xx_dongle { | ||
843 | + unsigned short vendor; | ||
844 | + unsigned short product; | ||
845 | +}; | ||
846 | + | ||
847 | +static const struct smsc95xx_dongle smsc95xx_dongles[] = { | ||
848 | + { 0x0424, 0xec00 }, /* LAN9512/LAN9514 Ethernet */ | ||
849 | + { 0x0424, 0x9500 }, /* LAN9500 Ethernet */ | ||
850 | + { 0x0000, 0x0000 } /* END - Do not remove */ | ||
851 | +}; | ||
852 | + | ||
853 | +/* Probe to see if a new device is actually an SMSC device */ | ||
854 | +int smsc95xx_eth_probe(struct usb_device *dev, unsigned int ifnum, | ||
855 | + struct ueth_data *ss) | ||
856 | +{ | ||
857 | + struct usb_interface *iface; | ||
858 | + struct usb_interface_descriptor *iface_desc; | ||
859 | + int i; | ||
860 | + | ||
861 | + /* let's examine the device now */ | ||
862 | + iface = &dev->config.if_desc[ifnum]; | ||
863 | + iface_desc = &dev->config.if_desc[ifnum].desc; | ||
864 | + | ||
865 | + for (i = 0; smsc95xx_dongles[i].vendor != 0; i++) { | ||
866 | + if (dev->descriptor.idVendor == smsc95xx_dongles[i].vendor && | ||
867 | + dev->descriptor.idProduct == smsc95xx_dongles[i].product) | ||
868 | + /* Found a supported dongle */ | ||
869 | + break; | ||
870 | + } | ||
871 | + if (smsc95xx_dongles[i].vendor == 0) | ||
872 | + return 0; | ||
873 | + | ||
874 | + /* At this point, we know we've got a live one */ | ||
875 | + debug("\n\nUSB Ethernet device detected\n"); | ||
876 | + memset(ss, '\0', sizeof(struct ueth_data)); | ||
877 | + | ||
878 | + /* Initialize the ueth_data structure with some useful info */ | ||
879 | + ss->ifnum = ifnum; | ||
880 | + ss->pusb_dev = dev; | ||
881 | + ss->subclass = iface_desc->bInterfaceSubClass; | ||
882 | + ss->protocol = iface_desc->bInterfaceProtocol; | ||
883 | + | ||
884 | + /* | ||
885 | + * We are expecting a minimum of 3 endpoints - in, out (bulk), and int. | ||
886 | + * We will ignore any others. | ||
887 | + */ | ||
888 | + for (i = 0; i < iface_desc->bNumEndpoints; i++) { | ||
889 | + /* is it an BULK endpoint? */ | ||
890 | + if ((iface->ep_desc[i].bmAttributes & | ||
891 | + USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK) { | ||
892 | + if (iface->ep_desc[i].bEndpointAddress & USB_DIR_IN) | ||
893 | + ss->ep_in = | ||
894 | + iface->ep_desc[i].bEndpointAddress & | ||
895 | + USB_ENDPOINT_NUMBER_MASK; | ||
896 | + else | ||
897 | + ss->ep_out = | ||
898 | + iface->ep_desc[i].bEndpointAddress & | ||
899 | + USB_ENDPOINT_NUMBER_MASK; | ||
900 | + } | ||
901 | + | ||
902 | + /* is it an interrupt endpoint? */ | ||
903 | + if ((iface->ep_desc[i].bmAttributes & | ||
904 | + USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) { | ||
905 | + ss->ep_int = iface->ep_desc[i].bEndpointAddress & | ||
906 | + USB_ENDPOINT_NUMBER_MASK; | ||
907 | + ss->irqinterval = iface->ep_desc[i].bInterval; | ||
908 | + } | ||
909 | + } | ||
910 | + debug("Endpoints In %d Out %d Int %d\n", | ||
911 | + ss->ep_in, ss->ep_out, ss->ep_int); | ||
912 | + | ||
913 | + /* Do some basic sanity checks, and bail if we find a problem */ | ||
914 | + if (usb_set_interface(dev, iface_desc->bInterfaceNumber, 0) || | ||
915 | + !ss->ep_in || !ss->ep_out || !ss->ep_int) { | ||
916 | + debug("Problems with device\n"); | ||
917 | + return 0; | ||
918 | + } | ||
919 | + dev->privptr = (void *)ss; | ||
920 | + return 1; | ||
921 | +} | ||
922 | + | ||
923 | +int smsc95xx_eth_get_info(struct usb_device *dev, struct ueth_data *ss, | ||
924 | + struct eth_device *eth) | ||
925 | +{ | ||
926 | + debug("** %s()\n", __func__); | ||
927 | + if (!eth) { | ||
928 | + debug("%s: missing parameter.\n", __func__); | ||
929 | + return 0; | ||
930 | + } | ||
931 | + sprintf(eth->name, "%s%d", SMSC95XX_BASE_NAME, curr_eth_dev++); | ||
932 | + eth->init = smsc95xx_init; | ||
933 | + eth->send = smsc95xx_send; | ||
934 | + eth->recv = smsc95xx_recv; | ||
935 | + eth->halt = smsc95xx_halt; | ||
936 | + eth->write_hwaddr = smsc95xx_write_hwaddr; | ||
937 | + eth->priv = ss; | ||
938 | + return 1; | ||
939 | +} | ||
940 | diff --git a/drivers/usb/eth/usb_ether.c b/drivers/usb/eth/usb_ether.c | ||
941 | index 68a0883..7b55da3 100644 | ||
942 | --- a/drivers/usb/eth/usb_ether.c | ||
943 | +++ b/drivers/usb/eth/usb_ether.c | ||
944 | @@ -45,6 +45,13 @@ static const struct usb_eth_prob_dev prob_dev[] = { | ||
945 | .get_info = asix_eth_get_info, | ||
946 | }, | ||
947 | #endif | ||
948 | +#ifdef CONFIG_USB_ETHER_SMSC95XX | ||
949 | + { | ||
950 | + .before_probe = smsc95xx_eth_before_probe, | ||
951 | + .probe = smsc95xx_eth_probe, | ||
952 | + .get_info = smsc95xx_eth_get_info, | ||
953 | + }, | ||
954 | +#endif | ||
955 | { }, /* END */ | ||
956 | }; | ||
957 | |||
958 | diff --git a/include/usb_ether.h b/include/usb_ether.h | ||
959 | index 825c275..a7fb26b 100644 | ||
960 | --- a/include/usb_ether.h | ||
961 | +++ b/include/usb_ether.h | ||
962 | @@ -51,6 +51,11 @@ struct ueth_data { | ||
963 | unsigned char irqinterval; /* Intervall for IRQ Pipe */ | ||
964 | |||
965 | /* private fields for each driver can go here if needed */ | ||
966 | +#ifdef CONFIG_USB_ETHER_SMSC95XX | ||
967 | + size_t rx_urb_size; /* maximum USB URB size */ | ||
968 | + u32 mac_cr; /* MAC control register value */ | ||
969 | + int have_hwaddr; /* 1 if we have a hardware MAC address */ | ||
970 | +#endif | ||
971 | }; | ||
972 | |||
973 | /* | ||
974 | @@ -65,4 +70,12 @@ int asix_eth_get_info(struct usb_device *dev, struct ueth_data *ss, | ||
975 | struct eth_device *eth); | ||
976 | #endif | ||
977 | |||
978 | +#ifdef CONFIG_USB_ETHER_SMSC95XX | ||
979 | +void smsc95xx_eth_before_probe(void); | ||
980 | +int smsc95xx_eth_probe(struct usb_device *dev, unsigned int ifnum, | ||
981 | + struct ueth_data *ss); | ||
982 | +int smsc95xx_eth_get_info(struct usb_device *dev, struct ueth_data *ss, | ||
983 | + struct eth_device *eth); | ||
984 | +#endif | ||
985 | + | ||
986 | #endif /* __USB_ETHER_H__ */ | ||
987 | -- | ||
988 | 1.6.6.1 | ||
989 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0006-Add-Ethernet-hardware-MAC-address-framework-to-usbne.patch b/recipes-bsp/u-boot/u-boot/2011.06/0006-Add-Ethernet-hardware-MAC-address-framework-to-usbne.patch new file mode 100644 index 00000000..f38966ef --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0006-Add-Ethernet-hardware-MAC-address-framework-to-usbne.patch | |||
@@ -0,0 +1,245 @@ | |||
1 | From f8ff7b1760739c33b1b0aa5a88d903e6e8945f1c Mon Sep 17 00:00:00 2001 | ||
2 | From: Simon Glass <sjg@chromium.org> | ||
3 | Date: Mon, 13 Jun 2011 13:13:10 +0000 | ||
4 | Subject: [PATCH 06/30] Add Ethernet hardware MAC address framework to usbnet | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Built-in Ethernet adapters support setting the mac address by means of a | ||
10 | ethaddr environment variable for each interface (ethaddr, eth1addr, eth2addr). | ||
11 | |||
12 | This adds similar support to the USB network side, using the names | ||
13 | usbethaddr, usbeth1addr, etc. They are kept separate since we don't want | ||
14 | a USB device taking the MAC address of a built-in device or vice versa. | ||
15 | |||
16 | Changes for v2: | ||
17 | - eth_set_hwaddr -> eth_write_hwaddr | ||
18 | - tided up other users of eth_getenv_enetaddr_by_index() | ||
19 | |||
20 | Changes for v5: | ||
21 | - Changed NULL to "eth" in eth_getenv_enetaddr_by_index() API | ||
22 | |||
23 | Signed-off-by: Simon Glass <sjg@chromium.org> | ||
24 | Tested-by: Eric Bénard <eric@eukrea.com> | ||
25 | --- | ||
26 | board/davinci/common/misc.c | 2 +- | ||
27 | drivers/net/designware.c | 2 +- | ||
28 | drivers/usb/eth/usb_ether.c | 9 +++++- | ||
29 | include/net.h | 25 ++++++++++++++++- | ||
30 | net/eth.c | 64 ++++++++++++++++++++++++++----------------- | ||
31 | 5 files changed, 72 insertions(+), 30 deletions(-) | ||
32 | |||
33 | diff --git a/board/davinci/common/misc.c b/board/davinci/common/misc.c | ||
34 | index 2bfdf23..53d6aa1 100644 | ||
35 | --- a/board/davinci/common/misc.c | ||
36 | +++ b/board/davinci/common/misc.c | ||
37 | @@ -101,7 +101,7 @@ void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr) | ||
38 | { | ||
39 | uint8_t env_enetaddr[6]; | ||
40 | |||
41 | - eth_getenv_enetaddr_by_index(0, env_enetaddr); | ||
42 | + eth_getenv_enetaddr_by_index("eth", 0, env_enetaddr); | ||
43 | if (!memcmp(env_enetaddr, "\0\0\0\0\0\0", 6)) { | ||
44 | /* There is no MAC address in the environment, so we initialize | ||
45 | * it from the value in the EEPROM. */ | ||
46 | diff --git a/drivers/net/designware.c b/drivers/net/designware.c | ||
47 | index 3f5eeb7..02ba393 100644 | ||
48 | --- a/drivers/net/designware.c | ||
49 | +++ b/drivers/net/designware.c | ||
50 | @@ -500,7 +500,7 @@ int designware_initialize(u32 id, ulong base_addr, u32 phy_addr) | ||
51 | dev->iobase = (int)base_addr; | ||
52 | dev->priv = priv; | ||
53 | |||
54 | - eth_getenv_enetaddr_by_index(id, &dev->enetaddr[0]); | ||
55 | + eth_getenv_enetaddr_by_index("eth", id, &dev->enetaddr[0]); | ||
56 | |||
57 | priv->dev = dev; | ||
58 | priv->mac_regs_p = (struct eth_mac_regs *)base_addr; | ||
59 | diff --git a/drivers/usb/eth/usb_ether.c b/drivers/usb/eth/usb_ether.c | ||
60 | index 7b55da3..6565ea5 100644 | ||
61 | --- a/drivers/usb/eth/usb_ether.c | ||
62 | +++ b/drivers/usb/eth/usb_ether.c | ||
63 | @@ -80,6 +80,7 @@ int is_eth_dev_on_usb_host(void) | ||
64 | */ | ||
65 | static void probe_valid_drivers(struct usb_device *dev) | ||
66 | { | ||
67 | + struct eth_device *eth; | ||
68 | int j; | ||
69 | |||
70 | for (j = 0; prob_dev[j].probe && prob_dev[j].get_info; j++) { | ||
71 | @@ -88,9 +89,10 @@ static void probe_valid_drivers(struct usb_device *dev) | ||
72 | /* | ||
73 | * ok, it is a supported eth device. Get info and fill it in | ||
74 | */ | ||
75 | + eth = &usb_eth[usb_max_eth_dev].eth_dev; | ||
76 | if (prob_dev[j].get_info(dev, | ||
77 | &usb_eth[usb_max_eth_dev], | ||
78 | - &usb_eth[usb_max_eth_dev].eth_dev)) { | ||
79 | + eth)) { | ||
80 | /* found proper driver */ | ||
81 | /* register with networking stack */ | ||
82 | usb_max_eth_dev++; | ||
83 | @@ -100,7 +102,10 @@ static void probe_valid_drivers(struct usb_device *dev) | ||
84 | * call since eth_current_changed (internally called) | ||
85 | * relies on it | ||
86 | */ | ||
87 | - eth_register(&usb_eth[usb_max_eth_dev - 1].eth_dev); | ||
88 | + eth_register(eth); | ||
89 | + if (eth_write_hwaddr(eth, "usbeth", | ||
90 | + usb_max_eth_dev - 1)) | ||
91 | + puts("Warning: failed to set MAC address\n"); | ||
92 | break; | ||
93 | } | ||
94 | } | ||
95 | diff --git a/include/net.h b/include/net.h | ||
96 | index 018a744..ce54825 100644 | ||
97 | --- a/include/net.h | ||
98 | +++ b/include/net.h | ||
99 | @@ -128,7 +128,18 @@ extern int eth_get_dev_index (void); /* get the device index */ | ||
100 | extern void eth_parse_enetaddr(const char *addr, uchar *enetaddr); | ||
101 | extern int eth_getenv_enetaddr(char *name, uchar *enetaddr); | ||
102 | extern int eth_setenv_enetaddr(char *name, const uchar *enetaddr); | ||
103 | -extern int eth_getenv_enetaddr_by_index(int index, uchar *enetaddr); | ||
104 | + | ||
105 | +/* | ||
106 | + * Get the hardware address for an ethernet interface . | ||
107 | + * Args: | ||
108 | + * base_name - base name for device (normally "eth") | ||
109 | + * index - device index number (0 for first) | ||
110 | + * enetaddr - returns 6 byte hardware address | ||
111 | + * Returns: | ||
112 | + * Return true if the address is valid. | ||
113 | + */ | ||
114 | +extern int eth_getenv_enetaddr_by_index(const char *base_name, int index, | ||
115 | + uchar *enetaddr); | ||
116 | |||
117 | extern int usb_eth_initialize(bd_t *bi); | ||
118 | extern int eth_init(bd_t *bis); /* Initialize the device */ | ||
119 | @@ -141,6 +152,18 @@ extern int eth_rx(void); /* Check for received packets */ | ||
120 | extern void eth_halt(void); /* stop SCC */ | ||
121 | extern char *eth_get_name(void); /* get name of current device */ | ||
122 | |||
123 | +/* | ||
124 | + * Set the hardware address for an ethernet interface based on 'eth%daddr' | ||
125 | + * environment variable (or just 'ethaddr' if eth_number is 0). | ||
126 | + * Args: | ||
127 | + * base_name - base name for device (normally "eth") | ||
128 | + * eth_number - value of %d (0 for first device of this type) | ||
129 | + * Returns: | ||
130 | + * 0 is success, non-zero is error status from driver. | ||
131 | + */ | ||
132 | +int eth_write_hwaddr(struct eth_device *dev, const char *base_name, | ||
133 | + int eth_number); | ||
134 | + | ||
135 | #ifdef CONFIG_MCAST_TFTP | ||
136 | int eth_mcast_join( IPaddr_t mcast_addr, u8 join); | ||
137 | u32 ether_crc (size_t len, unsigned char const *p); | ||
138 | diff --git a/net/eth.c b/net/eth.c | ||
139 | index 6523834..b3ea565 100644 | ||
140 | --- a/net/eth.c | ||
141 | +++ b/net/eth.c | ||
142 | @@ -54,10 +54,11 @@ int eth_setenv_enetaddr(char *name, const uchar *enetaddr) | ||
143 | return setenv(name, buf); | ||
144 | } | ||
145 | |||
146 | -int eth_getenv_enetaddr_by_index(int index, uchar *enetaddr) | ||
147 | +int eth_getenv_enetaddr_by_index(const char *base_name, int index, | ||
148 | + uchar *enetaddr) | ||
149 | { | ||
150 | char enetvar[32]; | ||
151 | - sprintf(enetvar, index ? "eth%daddr" : "ethaddr", index); | ||
152 | + sprintf(enetvar, index ? "%s%daddr" : "%saddr", base_name, index); | ||
153 | return eth_getenv_enetaddr(enetvar, enetaddr); | ||
154 | } | ||
155 | |||
156 | @@ -188,6 +189,38 @@ static void eth_current_changed(void) | ||
157 | #endif | ||
158 | } | ||
159 | |||
160 | +int eth_write_hwaddr(struct eth_device *dev, const char *base_name, | ||
161 | + int eth_number) | ||
162 | +{ | ||
163 | + unsigned char env_enetaddr[6]; | ||
164 | + int ret = 0; | ||
165 | + | ||
166 | + if (!eth_getenv_enetaddr_by_index(base_name, eth_number, env_enetaddr)) | ||
167 | + return -1; | ||
168 | + | ||
169 | + if (memcmp(env_enetaddr, "\0\0\0\0\0\0", 6)) { | ||
170 | + if (memcmp(dev->enetaddr, "\0\0\0\0\0\0", 6) && | ||
171 | + memcmp(dev->enetaddr, env_enetaddr, 6)) { | ||
172 | + printf("\nWarning: %s MAC addresses don't match:\n", | ||
173 | + dev->name); | ||
174 | + printf("Address in SROM is %pM\n", | ||
175 | + dev->enetaddr); | ||
176 | + printf("Address in environment is %pM\n", | ||
177 | + env_enetaddr); | ||
178 | + } | ||
179 | + | ||
180 | + memcpy(dev->enetaddr, env_enetaddr, 6); | ||
181 | + } | ||
182 | + | ||
183 | + if (dev->write_hwaddr && | ||
184 | + !eth_mac_skip(eth_number) && | ||
185 | + is_valid_ether_addr(dev->enetaddr)) { | ||
186 | + ret = dev->write_hwaddr(dev); | ||
187 | + } | ||
188 | + | ||
189 | + return ret; | ||
190 | +} | ||
191 | + | ||
192 | int eth_register(struct eth_device *dev) | ||
193 | { | ||
194 | struct eth_device *d; | ||
195 | @@ -208,7 +241,6 @@ int eth_register(struct eth_device *dev) | ||
196 | |||
197 | int eth_initialize(bd_t *bis) | ||
198 | { | ||
199 | - unsigned char env_enetaddr[6]; | ||
200 | int eth_number = 0; | ||
201 | |||
202 | eth_devices = NULL; | ||
203 | @@ -264,27 +296,8 @@ int eth_initialize(bd_t *bis) | ||
204 | if (strchr(dev->name, ' ')) | ||
205 | puts("\nWarning: eth device name has a space!\n"); | ||
206 | |||
207 | - eth_getenv_enetaddr_by_index(eth_number, env_enetaddr); | ||
208 | - | ||
209 | - if (memcmp(env_enetaddr, "\0\0\0\0\0\0", 6)) { | ||
210 | - if (memcmp(dev->enetaddr, "\0\0\0\0\0\0", 6) && | ||
211 | - memcmp(dev->enetaddr, env_enetaddr, 6)) | ||
212 | - { | ||
213 | - printf ("\nWarning: %s MAC addresses don't match:\n", | ||
214 | - dev->name); | ||
215 | - printf ("Address in SROM is %pM\n", | ||
216 | - dev->enetaddr); | ||
217 | - printf ("Address in environment is %pM\n", | ||
218 | - env_enetaddr); | ||
219 | - } | ||
220 | - | ||
221 | - memcpy(dev->enetaddr, env_enetaddr, 6); | ||
222 | - } | ||
223 | - if (dev->write_hwaddr && | ||
224 | - !eth_mac_skip(eth_number) && | ||
225 | - is_valid_ether_addr(dev->enetaddr)) { | ||
226 | - dev->write_hwaddr(dev); | ||
227 | - } | ||
228 | + if (eth_write_hwaddr(dev, NULL, eth_number)) | ||
229 | + puts("Warning: failed to set MAC address\n"); | ||
230 | |||
231 | eth_number++; | ||
232 | dev = dev->next; | ||
233 | @@ -359,7 +372,8 @@ int eth_init(bd_t *bis) | ||
234 | do { | ||
235 | uchar env_enetaddr[6]; | ||
236 | |||
237 | - if (eth_getenv_enetaddr_by_index(eth_number, env_enetaddr)) | ||
238 | + if (eth_getenv_enetaddr_by_index("eth", eth_number, | ||
239 | + env_enetaddr)) | ||
240 | memcpy(dev->enetaddr, env_enetaddr, 6); | ||
241 | |||
242 | ++eth_number; | ||
243 | -- | ||
244 | 1.6.6.1 | ||
245 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0007-Add-documentation-for-USB-Host-Networking.patch b/recipes-bsp/u-boot/u-boot/2011.06/0007-Add-documentation-for-USB-Host-Networking.patch new file mode 100644 index 00000000..f2f1cecb --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0007-Add-documentation-for-USB-Host-Networking.patch | |||
@@ -0,0 +1,188 @@ | |||
1 | From 48938b9136e85d7399b8cc831731acd26dfb2e08 Mon Sep 17 00:00:00 2001 | ||
2 | From: Simon Glass <sjg@chromium.org> | ||
3 | Date: Mon, 13 Jun 2011 13:13:11 +0000 | ||
4 | Subject: [PATCH 07/30] Add documentation for USB Host Networking | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | This describes what it is for, devices supported, how to enable for your | ||
10 | board in U-Boot, setting up the server, and notes about MAC addresses. | ||
11 | |||
12 | Changes for v6: | ||
13 | - Adjust documentation file according to Wolfgang's comments | ||
14 | |||
15 | Signed-off-by: Simon Glass <sjg@chromium.org> | ||
16 | Tested-by: Eric Bénard <eric@eukrea.com> | ||
17 | --- | ||
18 | doc/README.usb | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- | ||
19 | 1 files changed, 156 insertions(+), 1 deletions(-) | ||
20 | |||
21 | diff --git a/doc/README.usb b/doc/README.usb | ||
22 | index 9aa4f62..a8a4058 100644 | ||
23 | --- a/doc/README.usb | ||
24 | +++ b/doc/README.usb | ||
25 | @@ -79,4 +79,159 @@ CONFIG_USB_UHCI defines the lowlevel part.A lowlevel part must be defined | ||
26 | if using CONFIG_CMD_USB | ||
27 | CONFIG_USB_KEYBOARD enables the USB Keyboard | ||
28 | CONFIG_USB_STORAGE enables the USB storage devices | ||
29 | -CONFIG_USB_HOST_ETHER enables USB ethernet dongle support | ||
30 | +CONFIG_USB_HOST_ETHER enables USB ethernet adapter support | ||
31 | + | ||
32 | + | ||
33 | +USB Host Networking | ||
34 | +=================== | ||
35 | + | ||
36 | +If you have a supported USB Ethernet adapter you can use it in U-Boot | ||
37 | +to obtain an IP address and load a kernel from a network server. | ||
38 | + | ||
39 | +Note: USB Host Networking is not the same as making your board act as a USB | ||
40 | +client. In that case your board is pretending to be an Ethernet adapter | ||
41 | +and will appear as a network interface to an attached computer. In that | ||
42 | +case the connection is via a USB cable with the computer acting as the host. | ||
43 | + | ||
44 | +With USB Host Networking, your board is the USB host. It controls the | ||
45 | +Ethernet adapter to which it is directly connected and the connection to | ||
46 | +the outside world is your adapter's Ethernet cable. Your board becomes an | ||
47 | +independent network device, able to connect and perform network operations | ||
48 | +independently of your computer. | ||
49 | + | ||
50 | + | ||
51 | +Device support | ||
52 | +-------------- | ||
53 | + | ||
54 | +Currently supported devices are listed in the drivers according to | ||
55 | +their vendor and product IDs. You can check your device by connecting it | ||
56 | +to a Linux machine and typing 'lsusb'. The drivers are in | ||
57 | +drivers/usb/eth. | ||
58 | + | ||
59 | +For example this lsusb output line shows a device with Vendor ID 0x0x95 | ||
60 | +and product ID 0x7720: | ||
61 | + | ||
62 | +Bus 002 Device 010: ID 0b95:7720 ASIX Electronics Corp. AX88772 | ||
63 | + | ||
64 | +If you look at drivers/usb/eth/asix.c you will see this line within the | ||
65 | +supported device list, so we know this adapter is supported. | ||
66 | + | ||
67 | + { 0x0b95, 0x7720 }, /* Trendnet TU2-ET100 V3.0R */ | ||
68 | + | ||
69 | +If your adapter is not listed there is a still a chance that it will | ||
70 | +work. Try looking up the manufacturer of the chip inside your adapter. | ||
71 | +or take the adapter apart and look for chip markings. Then add a line | ||
72 | +for your vendor/product ID into the table of the appropriate driver, | ||
73 | +build U-Boot and see if it works. If not then there might be differences | ||
74 | +between the chip in your adapter and the driver. You could try to get a | ||
75 | +datasheet for your device and add support for it to U-Boot. This is not | ||
76 | +particularly difficult - you only need to provide support for four basic | ||
77 | +functions: init, halt, send and recv. | ||
78 | + | ||
79 | + | ||
80 | +Enabling USB Host Networking | ||
81 | +---------------------------- | ||
82 | + | ||
83 | +The normal U-Boot commands are used with USB networking, but you must | ||
84 | +start USB first. For example: | ||
85 | + | ||
86 | +usb start | ||
87 | +setenv bootfile /tftpboot/uImage | ||
88 | +bootp | ||
89 | + | ||
90 | + | ||
91 | +To enable USB Host Ethernet in U-Boot, your platform must of course | ||
92 | +support USB with CONFIG_CMD_USB enabled and working. You will need to | ||
93 | +add some config settings to your board header file: | ||
94 | + | ||
95 | +#define CONFIG_USB_HOST_ETHER /* Enable USB Ethernet adapters */ | ||
96 | +#define CONFIG_USB_ETHER_ASIX /* Asix, or whatever driver(s) you want */ | ||
97 | + | ||
98 | +As with built-in networking, you will also want to enable some network | ||
99 | +commands, for example: | ||
100 | + | ||
101 | +#define CONFIG_CMD_NET | ||
102 | +#define CONFIG_NET_MULTI | ||
103 | +#define CONFIG_CMD_PING | ||
104 | +#define CONFIG_CMD_DHCP | ||
105 | + | ||
106 | +and some bootp options, which tell your board to obtain its subnet, | ||
107 | +gateway IP, host name and boot path from the bootp/dhcp server. These | ||
108 | +settings should start you off: | ||
109 | + | ||
110 | +#define CONFIG_BOOTP_SUBNETMASK | ||
111 | +#define CONFIG_BOOTP_GATEWAY | ||
112 | +#define CONFIG_BOOTP_HOSTNAME | ||
113 | +#define CONFIG_BOOTP_BOOTPATH | ||
114 | + | ||
115 | +You can also set the default IP address of your board and the server | ||
116 | +as well as the default file to load when a 'bootp' command is issued. | ||
117 | +All of these can be obtained from the bootp server if not set. | ||
118 | + | ||
119 | +#define CONFIG_IPADDR 10.0.0.2 (replace with your value) | ||
120 | +#define CONFIG_SERVERIP 10.0.0.1 (replace with your value) | ||
121 | +#define CONFIG_BOOTFILE uImage | ||
122 | + | ||
123 | + | ||
124 | +The 'usb start' command should identify the adapter something like this: | ||
125 | + | ||
126 | +CrOS> usb start | ||
127 | +(Re)start USB... | ||
128 | +USB EHCI 1.00 | ||
129 | +scanning bus for devices... 3 USB Device(s) found | ||
130 | + scanning bus for storage devices... 0 Storage Device(s) found | ||
131 | + scanning bus for ethernet devices... 1 Ethernet Device(s) found | ||
132 | +CrOS> print ethact | ||
133 | +ethact=asx0 | ||
134 | + | ||
135 | +You can see that it found an ethernet device and we can print out the | ||
136 | +device name (asx0 in this case). | ||
137 | + | ||
138 | +Then 'bootp' or 'dhcp' should use it to obtain an IP address from DHCP, | ||
139 | +perhaps something like this: | ||
140 | + | ||
141 | +CrOS> bootp | ||
142 | +Waiting for Ethernet connection... done. | ||
143 | +BOOTP broadcast 1 | ||
144 | +BOOTP broadcast 2 | ||
145 | +DHCP client bound to address 172.22.73.81 | ||
146 | +Using asx0 device | ||
147 | +TFTP from server 172.22.72.144; our IP address is 172.22.73.81 | ||
148 | +Filename '/tftpboot/uImage-sjg-seaboard-261347'. | ||
149 | +Load address: 0x40c000 | ||
150 | +Loading: ################################################################# | ||
151 | + ################################################################# | ||
152 | + ################################################################# | ||
153 | + ################################################ | ||
154 | +done | ||
155 | +Bytes transferred = 3557464 (364858 hex) | ||
156 | +CrOS> | ||
157 | + | ||
158 | + | ||
159 | +Another way of doing this is to issue a tftp command, which will cause the | ||
160 | +bootp to happen automatically. | ||
161 | + | ||
162 | + | ||
163 | +MAC Addresses | ||
164 | +------------- | ||
165 | + | ||
166 | +Most Ethernet dongles have a built-in MAC address which is unique in the | ||
167 | +world. This is important so that devices on the network can be | ||
168 | +distinguised from each other. MAC address conflicts are evil and | ||
169 | +generally result in strange and eratic behaviour. | ||
170 | + | ||
171 | +Some boards have USB Ethernet chips on-board, and these sometimes do not | ||
172 | +have an assigned MAC address. In this case it is up to you to assign | ||
173 | +one which is unique. You should obtain a valid MAC address from a range | ||
174 | +assigned to you before you ship the product. | ||
175 | + | ||
176 | +Built-in Ethernet adapters support setting the MAC address by means of | ||
177 | +an ethaddr environment variable for each interface (ethaddr, eth1addr, | ||
178 | +eth2addr). There is similar support on the USB network side, using the | ||
179 | +names usbethaddr, usbeth1addr, etc. They are kept separate since we | ||
180 | +don't want a USB device taking the MAC address of a built-in device or | ||
181 | +vice versa. | ||
182 | + | ||
183 | +So if your USB Ethernet chip doesn't have a MAC address available then | ||
184 | +you must set usbethaddr to a suitable MAC address. At the time of | ||
185 | +writing this functionality is only supported by the SMSC driver. | ||
186 | -- | ||
187 | 1.6.6.1 | ||
188 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0008-dm3730-enable-dpll5.patch b/recipes-bsp/u-boot/u-boot/2011.06/0008-dm3730-enable-dpll5.patch new file mode 100644 index 00000000..5553c58d --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0008-dm3730-enable-dpll5.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From a13358a747c33ecda28a976ed9450b9351827c2a Mon Sep 17 00:00:00 2001 | ||
2 | From: Eric Benard <eric@eukrea.com> | ||
3 | Date: Fri, 10 Jun 2011 12:21:52 +0000 | ||
4 | Subject: [PATCH 08/30] dm3730: enable dpll5 | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | which is used to provide 120MHz to USB EHCI | ||
10 | This allows EHCI to work on BeagleBoard XM | ||
11 | |||
12 | Signed-off-by: Eric Bénard <eric@eukrea.com> | ||
13 | --- | ||
14 | arch/arm/cpu/armv7/omap3/clock.c | 1 + | ||
15 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
16 | |||
17 | diff --git a/arch/arm/cpu/armv7/omap3/clock.c b/arch/arm/cpu/armv7/omap3/clock.c | ||
18 | index 3d38d08..6a9edcf 100644 | ||
19 | --- a/arch/arm/cpu/armv7/omap3/clock.c | ||
20 | +++ b/arch/arm/cpu/armv7/omap3/clock.c | ||
21 | @@ -579,6 +579,7 @@ void prcm_init(void) | ||
22 | |||
23 | dpll3_init_36xx(0, clk_index); | ||
24 | dpll4_init_36xx(0, clk_index); | ||
25 | + dpll5_init_34xx(0, clk_index); | ||
26 | iva_init_36xx(0, clk_index); | ||
27 | mpu_init_36xx(0, clk_index); | ||
28 | |||
29 | -- | ||
30 | 1.6.6.1 | ||
31 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0009-beagleboard-enable-HUB-power-on-XM-boards.patch b/recipes-bsp/u-boot/u-boot/2011.06/0009-beagleboard-enable-HUB-power-on-XM-boards.patch new file mode 100644 index 00000000..9dfb34bc --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0009-beagleboard-enable-HUB-power-on-XM-boards.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From 48f6f945c028a83725ab962cbff5120ac5280cd0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Eric Benard <eric@eukrea.com> | ||
3 | Date: Fri, 17 Jun 2011 09:24:24 +0200 | ||
4 | Subject: [PATCH 09/30] beagleboard: enable HUB power on XM boards | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | LEDA needs to be at level 0 to enable HUB_3V3 | ||
10 | |||
11 | Signed-off-by: Eric Bénard <eric@eukrea.com> | ||
12 | --- | ||
13 | board/ti/beagle/beagle.c | 11 +++++++++-- | ||
14 | 1 files changed, 9 insertions(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c | ||
17 | index 7768901..a6ce5a8 100644 | ||
18 | --- a/board/ti/beagle/beagle.c | ||
19 | +++ b/board/ti/beagle/beagle.c | ||
20 | @@ -309,8 +309,15 @@ int misc_init_r(void) | ||
21 | setenv(expansion_config.env_var, expansion_config.env_setting); | ||
22 | |||
23 | twl4030_power_init(); | ||
24 | - twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON); | ||
25 | - | ||
26 | + switch (get_board_revision()) { | ||
27 | + case REVISION_C4: | ||
28 | + case REVISION_XM_C: | ||
29 | + twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON); | ||
30 | + break; | ||
31 | + default: | ||
32 | + twl4030_led_init(TWL4030_LED_LEDEN_LEDBON); | ||
33 | + break; | ||
34 | + } | ||
35 | /* Set GPIO states before they are made outputs */ | ||
36 | writel(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1, | ||
37 | &gpio6_base->setdataout); | ||
38 | -- | ||
39 | 1.6.6.1 | ||
40 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0010-beagleboard-turn-off-clocks-in-ehci_stop.patch b/recipes-bsp/u-boot/u-boot/2011.06/0010-beagleboard-turn-off-clocks-in-ehci_stop.patch new file mode 100644 index 00000000..a6898aa3 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0010-beagleboard-turn-off-clocks-in-ehci_stop.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From 9ae080a8b4f2a580c2bf3fb790fb141e1e618ef7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Fri, 17 Jun 2011 09:26:17 +0200 | ||
4 | Subject: [PATCH 10/30] beagleboard: turn off clocks in ehci_stop | ||
5 | |||
6 | This fixes display problems in linux | ||
7 | |||
8 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
9 | --- | ||
10 | board/ti/beagle/beagle.c | 6 ++++++ | ||
11 | 1 files changed, 6 insertions(+), 0 deletions(-) | ||
12 | |||
13 | diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c | ||
14 | index a6ce5a8..a290f89 100644 | ||
15 | --- a/board/ti/beagle/beagle.c | ||
16 | +++ b/board/ti/beagle/beagle.c | ||
17 | @@ -363,6 +363,12 @@ int ehci_hcd_stop(void) | ||
18 | pr_debug("Resetting OMAP3 EHCI\n"); | ||
19 | omap_set_gpio_dataout(GPIO_PHY_RESET, 0); | ||
20 | writel(OMAP_UHH_SYSCONFIG_SOFTRESET, OMAP3_UHH_BASE + OMAP_UHH_SYSCONFIG); | ||
21 | + /* disable USB clocks */ | ||
22 | + struct prcm *prcm_base = (struct prcm *)PRCM_BASE; | ||
23 | + sr32(&prcm_base->iclken_usbhost, 0, 1, 0); | ||
24 | + sr32(&prcm_base->fclken_usbhost, 0, 2, 0); | ||
25 | + sr32(&prcm_base->iclken3_core, 2, 1, 0); | ||
26 | + sr32(&prcm_base->fclken3_core, 2, 1, 0); | ||
27 | return 0; | ||
28 | } | ||
29 | |||
30 | -- | ||
31 | 1.6.6.1 | ||
32 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0011-beagleboard-enable-networking.patch b/recipes-bsp/u-boot/u-boot/2011.06/0011-beagleboard-enable-networking.patch new file mode 100644 index 00000000..1935475d --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0011-beagleboard-enable-networking.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From c3d4be5f60700c3e30f00818211775a2c8398e2f Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Fri, 17 Jun 2011 09:31:09 +0200 | ||
4 | Subject: [PATCH 11/30] beagleboard: enable networking | ||
5 | |||
6 | --- | ||
7 | include/configs/omap3_beagle.h | 10 ++++++++-- | ||
8 | 1 files changed, 8 insertions(+), 2 deletions(-) | ||
9 | |||
10 | diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h | ||
11 | index d5f98da..2daf06d 100644 | ||
12 | --- a/include/configs/omap3_beagle.h | ||
13 | +++ b/include/configs/omap3_beagle.h | ||
14 | @@ -129,6 +129,10 @@ | ||
15 | #define CONFIG_CMD_USB | ||
16 | #define CONFIG_USB_EHCI | ||
17 | #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3 | ||
18 | +#define CONFIG_USB_HOST_ETHER | ||
19 | +#define CONFIG_USB_ETHER_SMSC95XX | ||
20 | + | ||
21 | +#define CONFIG_NET_MULTI | ||
22 | |||
23 | /* commands to include */ | ||
24 | #include <config_cmd_default.h> | ||
25 | @@ -149,13 +153,15 @@ | ||
26 | #define CONFIG_USB_STORAGE /* USB storage support */ | ||
27 | #define CONFIG_CMD_NAND /* NAND support */ | ||
28 | #define CONFIG_CMD_LED /* LED support */ | ||
29 | +#define CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */ | ||
30 | +#define CONFIG_CMD_NFS /* NFS support */ | ||
31 | +#define CONFIG_CMD_PING | ||
32 | + | ||
33 | |||
34 | #undef CONFIG_CMD_FLASH /* flinfo, erase, protect */ | ||
35 | #undef CONFIG_CMD_FPGA /* FPGA configuration Support */ | ||
36 | #undef CONFIG_CMD_IMI /* iminfo */ | ||
37 | #undef CONFIG_CMD_IMLS /* List all found images */ | ||
38 | -#undef CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */ | ||
39 | -#undef CONFIG_CMD_NFS /* NFS support */ | ||
40 | |||
41 | #define CONFIG_SYS_NO_FLASH | ||
42 | #define CONFIG_HARD_I2C 1 | ||
43 | -- | ||
44 | 1.6.6.1 | ||
45 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0012-beagleboard-switch-to-ttyO2-as-console.patch b/recipes-bsp/u-boot/u-boot/2011.06/0012-beagleboard-switch-to-ttyO2-as-console.patch new file mode 100644 index 00000000..c25c2ad8 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0012-beagleboard-switch-to-ttyO2-as-console.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | From 04a20a72599d016785d751381fb1ea5112fb0de8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Fri, 17 Jun 2011 09:32:17 +0200 | ||
4 | Subject: [PATCH 12/30] beagleboard: switch to ttyO2 as console | ||
5 | |||
6 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
7 | --- | ||
8 | include/configs/omap3_beagle.h | 2 +- | ||
9 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
10 | |||
11 | diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h | ||
12 | index 2daf06d..9a161cf 100644 | ||
13 | --- a/include/configs/omap3_beagle.h | ||
14 | +++ b/include/configs/omap3_beagle.h | ||
15 | @@ -206,7 +206,7 @@ | ||
16 | #define CONFIG_EXTRA_ENV_SETTINGS \ | ||
17 | "loadaddr=0x82000000\0" \ | ||
18 | "usbtty=cdc_acm\0" \ | ||
19 | - "console=ttyS2,115200n8\0" \ | ||
20 | + "console=ttyO2,115200n8\0" \ | ||
21 | "mpurate=auto\0" \ | ||
22 | "buddy=none "\ | ||
23 | "vram=12M\0" \ | ||
24 | -- | ||
25 | 1.6.6.1 | ||
26 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0013-beagleboard-load-kernel-from-MMC-ext-not-FAT.patch b/recipes-bsp/u-boot/u-boot/2011.06/0013-beagleboard-load-kernel-from-MMC-ext-not-FAT.patch new file mode 100644 index 00000000..28005be2 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0013-beagleboard-load-kernel-from-MMC-ext-not-FAT.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | From 91da655eb768b52d085fac42648e6bcf342a1f7f Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Fri, 17 Jun 2011 09:33:03 +0200 | ||
4 | Subject: [PATCH 13/30] beagleboard: load kernel from MMC ext, not FAT | ||
5 | |||
6 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
7 | --- | ||
8 | include/configs/omap3_beagle.h | 3 ++- | ||
9 | 1 files changed, 2 insertions(+), 1 deletions(-) | ||
10 | |||
11 | diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h | ||
12 | index 9a161cf..dbb77fb 100644 | ||
13 | --- a/include/configs/omap3_beagle.h | ||
14 | +++ b/include/configs/omap3_beagle.h | ||
15 | @@ -246,7 +246,8 @@ | ||
16 | "root=${ramroot} " \ | ||
17 | "rootfstype=${ramrootfstype}\0" \ | ||
18 | "loadramdisk=fatload mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \ | ||
19 | - "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \ | ||
20 | + "loaduimagefat=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \ | ||
21 | + "loaduimage=ext2load mmc ${mmcdev}:2 ${loadaddr} /boot/uImage\0" \ | ||
22 | "mmcboot=echo Booting from mmc ...; " \ | ||
23 | "run mmcargs; " \ | ||
24 | "bootm ${loadaddr}\0" \ | ||
25 | -- | ||
26 | 1.6.6.1 | ||
27 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0014-beagleboard-enable-asix-driver-and-dhcp.patch b/recipes-bsp/u-boot/u-boot/2011.06/0014-beagleboard-enable-asix-driver-and-dhcp.patch new file mode 100644 index 00000000..b14d227c --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0014-beagleboard-enable-asix-driver-and-dhcp.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From b8f56a9f7ab18641dd0f4529333b00918d34c95d Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Fri, 17 Jun 2011 09:47:08 +0200 | ||
4 | Subject: [PATCH 14/30] beagleboard: enable asix driver and dhcp | ||
5 | |||
6 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
7 | --- | ||
8 | include/configs/omap3_beagle.h | 3 ++- | ||
9 | 1 files changed, 2 insertions(+), 1 deletions(-) | ||
10 | |||
11 | diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h | ||
12 | index dbb77fb..49e9dd3 100644 | ||
13 | --- a/include/configs/omap3_beagle.h | ||
14 | +++ b/include/configs/omap3_beagle.h | ||
15 | @@ -131,6 +131,7 @@ | ||
16 | #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3 | ||
17 | #define CONFIG_USB_HOST_ETHER | ||
18 | #define CONFIG_USB_ETHER_SMSC95XX | ||
19 | +#define CONFIG_USB_ETHER_ASIX | ||
20 | |||
21 | #define CONFIG_NET_MULTI | ||
22 | |||
23 | @@ -156,7 +157,7 @@ | ||
24 | #define CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */ | ||
25 | #define CONFIG_CMD_NFS /* NFS support */ | ||
26 | #define CONFIG_CMD_PING | ||
27 | - | ||
28 | +#define CONFIG_CMD_DHCP | ||
29 | |||
30 | #undef CONFIG_CMD_FLASH /* flinfo, erase, protect */ | ||
31 | #undef CONFIG_CMD_FPGA /* FPGA configuration Support */ | ||
32 | -- | ||
33 | 1.6.6.1 | ||
34 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0015-beagleboard-hardcode-MAC-for-onboard-SMSC-and-use-uI.patch b/recipes-bsp/u-boot/u-boot/2011.06/0015-beagleboard-hardcode-MAC-for-onboard-SMSC-and-use-uI.patch new file mode 100644 index 00000000..56053db6 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0015-beagleboard-hardcode-MAC-for-onboard-SMSC-and-use-uI.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | From 2a713d6b62248a18ee798d08bbc7850accfc2e83 Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Fri, 17 Jun 2011 10:02:21 +0200 | ||
4 | Subject: [PATCH 15/30] beagleboard: hardcode MAC for onboard SMSC and use uImage.beagle fot tftp | ||
5 | |||
6 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
7 | --- | ||
8 | include/configs/omap3_beagle.h | 2 ++ | ||
9 | 1 files changed, 2 insertions(+), 0 deletions(-) | ||
10 | |||
11 | diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h | ||
12 | index 49e9dd3..894a071 100644 | ||
13 | --- a/include/configs/omap3_beagle.h | ||
14 | +++ b/include/configs/omap3_beagle.h | ||
15 | @@ -207,6 +207,8 @@ | ||
16 | #define CONFIG_EXTRA_ENV_SETTINGS \ | ||
17 | "loadaddr=0x82000000\0" \ | ||
18 | "usbtty=cdc_acm\0" \ | ||
19 | + "usbethaddr=de:ad:be:ef\0" \ | ||
20 | + "bootfile=uImage.beagle\0" \ | ||
21 | "console=ttyO2,115200n8\0" \ | ||
22 | "mpurate=auto\0" \ | ||
23 | "buddy=none "\ | ||
24 | -- | ||
25 | 1.6.6.1 | ||
26 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0016-beagleboard-decrease-bootdelay-to-2-seconds.patch b/recipes-bsp/u-boot/u-boot/2011.06/0016-beagleboard-decrease-bootdelay-to-2-seconds.patch new file mode 100644 index 00000000..0e56fc41 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0016-beagleboard-decrease-bootdelay-to-2-seconds.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | From ea8ed1da87f4612bdcbc611e6d4ccb9b7ea4d2ff Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Fri, 17 Jun 2011 10:03:06 +0200 | ||
4 | Subject: [PATCH 16/30] beagleboard: decrease bootdelay to 2 seconds | ||
5 | |||
6 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
7 | --- | ||
8 | include/configs/omap3_beagle.h | 2 +- | ||
9 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
10 | |||
11 | diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h | ||
12 | index 894a071..5c32265 100644 | ||
13 | --- a/include/configs/omap3_beagle.h | ||
14 | +++ b/include/configs/omap3_beagle.h | ||
15 | @@ -202,7 +202,7 @@ | ||
16 | /* partition */ | ||
17 | |||
18 | /* Environment information */ | ||
19 | -#define CONFIG_BOOTDELAY 10 | ||
20 | +#define CONFIG_BOOTDELAY 2 | ||
21 | |||
22 | #define CONFIG_EXTRA_ENV_SETTINGS \ | ||
23 | "loadaddr=0x82000000\0" \ | ||
24 | -- | ||
25 | 1.6.6.1 | ||
26 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0017-USB-Remove-__attribute__-packed-for-struct-ehci_hccr.patch b/recipes-bsp/u-boot/u-boot/2011.06/0017-USB-Remove-__attribute__-packed-for-struct-ehci_hccr.patch new file mode 100644 index 00000000..43312c96 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0017-USB-Remove-__attribute__-packed-for-struct-ehci_hccr.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | From 4099bd50da694cc35c489547ad0d8a30bd99006a Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Kridner <jkridner@beagleboard.org> | ||
3 | Date: Wed, 20 Apr 2011 08:54:16 -0500 | ||
4 | Subject: [PATCH 17/30] USB: Remove __attribute__ ((packed)) for struct ehci_hccr and ehci_hcor | ||
5 | |||
6 | Remove __attribute__ ((packed)) to prevent byte access to soc | ||
7 | registers in some gcc versions. | ||
8 | |||
9 | Having patches to enable ehci for the BeagleBoard lying around for | ||
10 | several month, this one was the show-stopper. | ||
11 | |||
12 | Credits have to go to Laine Walker-Avina <lwalkera@ieee.org> for | ||
13 | finding the problem. | ||
14 | |||
15 | Signed-off-by: Jason Kridner <jkridner@beagleboard.org> | ||
16 | Cc: Alexander Holler <holler@ahsoftware.de> | ||
17 | Cc: Sandeep Paulraj <s-paulraj@ti.com> | ||
18 | --- | ||
19 | Changes for v2: | ||
20 | * Original and v2 were provided by Alexander Holler. | ||
21 | * v1 was http://patchwork.ozlabs.org/patch/89358/ | ||
22 | * v2 was http://patchwork.ozlabs.org/patch/89362/ | ||
23 | |||
24 | Changes for v3: | ||
25 | * Switched to align(4), rather than remove the attribute, per suggestion | ||
26 | from Alexander. | ||
27 | |||
28 | Signed-off-by: Jason Kridner <jkridner@beagleboard.org> | ||
29 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
30 | --- | ||
31 | drivers/usb/host/ehci.h | 4 ++-- | ||
32 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
33 | |||
34 | diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h | ||
35 | index 945ab64..3d0ad0c 100644 | ||
36 | --- a/drivers/usb/host/ehci.h | ||
37 | +++ b/drivers/usb/host/ehci.h | ||
38 | @@ -55,7 +55,7 @@ struct ehci_hccr { | ||
39 | #define HCS_N_PORTS(p) (((p) >> 0) & 0xf) | ||
40 | uint32_t cr_hccparams; | ||
41 | uint8_t cr_hcsp_portrt[8]; | ||
42 | -} __attribute__ ((packed)); | ||
43 | +} __attribute__ ((packed, aligned(4))); | ||
44 | |||
45 | struct ehci_hcor { | ||
46 | uint32_t or_usbcmd; | ||
47 | @@ -85,7 +85,7 @@ struct ehci_hcor { | ||
48 | #define FLAG_CF (1 << 0) /* true: we'll support "high speed" */ | ||
49 | uint32_t or_portsc[CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS]; | ||
50 | uint32_t or_systune; | ||
51 | -} __attribute__ ((packed)); | ||
52 | +} __attribute__ ((packed, aligned(4))); | ||
53 | |||
54 | #define USBMODE 0x68 /* USB Device mode */ | ||
55 | #define USBMODE_SDIS (1 << 3) /* Stream disable */ | ||
56 | -- | ||
57 | 1.6.6.1 | ||
58 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0018-usb-Some-EHCI-chipsets-are-slow-to-respond.patch b/recipes-bsp/u-boot/u-boot/2011.06/0018-usb-Some-EHCI-chipsets-are-slow-to-respond.patch new file mode 100644 index 00000000..21a1db7a --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0018-usb-Some-EHCI-chipsets-are-slow-to-respond.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 7378bf55a895a957a5ea31c5fac5b53a844778d2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Cooper <u-boot@lakedaemon.net> | ||
3 | Date: Tue, 14 Jun 2011 05:58:12 +0000 | ||
4 | Subject: [PATCH 18/30] usb: Some EHCI chipsets are slow to respond. | ||
5 | |||
6 | This fixes 'EHCI timed out on TD...' on the dreamplug board. | ||
7 | |||
8 | Signed-off-by: Jason Cooper <u-boot@lakedaemon.net> | ||
9 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
10 | --- | ||
11 | include/usb.h | 2 +- | ||
12 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
13 | |||
14 | diff --git a/include/usb.h b/include/usb.h | ||
15 | index 53603a5..168e2b2 100644 | ||
16 | --- a/include/usb.h | ||
17 | +++ b/include/usb.h | ||
18 | @@ -46,7 +46,7 @@ | ||
19 | * This is the timeout to allow for submitting an urb in ms. We allow more | ||
20 | * time for a BULK device to react - some are slow. | ||
21 | */ | ||
22 | -#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 100) | ||
23 | +#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 500) | ||
24 | |||
25 | /* device request (setup) */ | ||
26 | struct devrequest { | ||
27 | -- | ||
28 | 1.6.6.1 | ||
29 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0019-OMAP3-Add-DSS-driver-for-OMAP3.patch b/recipes-bsp/u-boot/u-boot/2011.06/0019-OMAP3-Add-DSS-driver-for-OMAP3.patch new file mode 100644 index 00000000..b8df7d72 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0019-OMAP3-Add-DSS-driver-for-OMAP3.patch | |||
@@ -0,0 +1,349 @@ | |||
1 | From e6e189b6062f7af6b993420b9de9656e36739e66 Mon Sep 17 00:00:00 2001 | ||
2 | From: Syed Mohammed Khasim <khasim@ti.com> | ||
3 | Date: Tue, 12 Jan 2010 23:57:28 +0530 | ||
4 | Subject: [PATCH 19/30] OMAP3: Add DSS driver for OMAP3 | ||
5 | |||
6 | Supports dynamic panel configuration | ||
7 | Supports dynamic tv standard selection | ||
8 | Adds support for DSS register access through generic APIs | ||
9 | |||
10 | Incorporated DSS register access using structures. | ||
11 | |||
12 | Previous discussions are here | ||
13 | http://www.mail-archive.com/u-boot@lists.denx.de/msg27150.html | ||
14 | --- | ||
15 | v2 updates: | ||
16 | * Enable panel output for BeagleBoard | ||
17 | * BeagleBoard: Update DVI-D orange screen frequencies for xM | ||
18 | |||
19 | v3 updates: | ||
20 | * Remove non-platform (OMAP3) updates | ||
21 | |||
22 | Signed-off-by: Syed Mohammed Khasim <khasim@ti.com> | ||
23 | Signed-off-by: Jason Kridner <jkridner@beagleboard.org> | ||
24 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
25 | --- | ||
26 | arch/arm/include/asm/arch-omap3/dss.h | 173 +++++++++++++++++++++++++++++++++ | ||
27 | drivers/video/omap3_dss.c | 130 +++++++++++++++++++++++++ | ||
28 | 2 files changed, 303 insertions(+), 0 deletions(-) | ||
29 | create mode 100644 arch/arm/include/asm/arch-omap3/dss.h | ||
30 | create mode 100644 drivers/video/omap3_dss.c | ||
31 | |||
32 | diff --git a/arch/arm/include/asm/arch-omap3/dss.h b/arch/arm/include/asm/arch-omap3/dss.h | ||
33 | new file mode 100644 | ||
34 | index 0000000..e5e3b0d | ||
35 | --- /dev/null | ||
36 | +++ b/arch/arm/include/asm/arch-omap3/dss.h | ||
37 | @@ -0,0 +1,173 @@ | ||
38 | +/* | ||
39 | + * (C) Copyright 2010 | ||
40 | + * Texas Instruments, <www.ti.com> | ||
41 | + * Syed Mohammed Khasim <khasim@ti.com> | ||
42 | + * | ||
43 | + * Referred to Linux DSS driver files for OMAP3 | ||
44 | + * | ||
45 | + * See file CREDITS for list of people who contributed to this | ||
46 | + * project. | ||
47 | + * | ||
48 | + * This program is free software; you can redistribute it and/or | ||
49 | + * modify it under the terms of the GNU General Public License as | ||
50 | + * published by the Free Software Foundation's version 2 of | ||
51 | + * the License. | ||
52 | + * | ||
53 | + * This program is distributed in the hope that it will be useful, | ||
54 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
55 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
56 | + * GNU General Public License for more details. | ||
57 | + * | ||
58 | + * You should have received a copy of the GNU General Public License | ||
59 | + * along with this program; if not, write to the Free Software | ||
60 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
61 | + * MA 02111-1307 USA | ||
62 | + */ | ||
63 | + | ||
64 | +#ifndef DSS_H | ||
65 | +#define DSS_H | ||
66 | + | ||
67 | +/* | ||
68 | + * DSS Base Registers | ||
69 | + */ | ||
70 | +#define OMAP3_DSS_BASE 0x48050040 | ||
71 | +#define OMAP3_DISPC_BASE 0x48050440 | ||
72 | +#define OMAP3_VENC_BASE 0x48050C00 | ||
73 | + | ||
74 | +/* DSS Registers */ | ||
75 | +struct dss_regs { | ||
76 | + u32 control; /* 0x40 */ | ||
77 | + u32 sdi_control; /* 0x44 */ | ||
78 | + u32 pll_control; /* 0x48 */ | ||
79 | +}; | ||
80 | + | ||
81 | +/* DISPC Registers */ | ||
82 | +struct dispc_regs { | ||
83 | + u32 control; /* 0x40 */ | ||
84 | + u32 config; /* 0x44 */ | ||
85 | + u32 reserve_2; /* 0x48 */ | ||
86 | + u32 default_color0; /* 0x4C */ | ||
87 | + u32 default_color1; /* 0x50 */ | ||
88 | + u32 trans_color0; /* 0x54 */ | ||
89 | + u32 trans_color1; /* 0x58 */ | ||
90 | + u32 line_status; /* 0x5C */ | ||
91 | + u32 line_number; /* 0x60 */ | ||
92 | + u32 timing_h; /* 0x64 */ | ||
93 | + u32 timing_v; /* 0x68 */ | ||
94 | + u32 pol_freq; /* 0x6C */ | ||
95 | + u32 divisor; /* 0x70 */ | ||
96 | + u32 global_alpha; /* 0x74 */ | ||
97 | + u32 size_dig; /* 0x78 */ | ||
98 | + u32 size_lcd; /* 0x7C */ | ||
99 | +}; | ||
100 | + | ||
101 | +/* VENC Registers */ | ||
102 | +struct venc_regs { | ||
103 | + u32 rev_id; /* 0x00 */ | ||
104 | + u32 status; /* 0x04 */ | ||
105 | + u32 f_control; /* 0x08 */ | ||
106 | + u32 reserve_1; /* 0x0C */ | ||
107 | + u32 vidout_ctrl; /* 0x10 */ | ||
108 | + u32 sync_ctrl; /* 0x14 */ | ||
109 | + u32 reserve_2; /* 0x18 */ | ||
110 | + u32 llen; /* 0x1C */ | ||
111 | + u32 flens; /* 0x20 */ | ||
112 | + u32 hfltr_ctrl; /* 0x24 */ | ||
113 | + u32 cc_carr_wss_carr; /* 0x28 */ | ||
114 | + u32 c_phase; /* 0x2C */ | ||
115 | + u32 gain_u; /* 0x30 */ | ||
116 | + u32 gain_v; /* 0x34 */ | ||
117 | + u32 gain_y; /* 0x38 */ | ||
118 | + u32 black_level; /* 0x3C */ | ||
119 | + u32 blank_level; /* 0x40 */ | ||
120 | + u32 x_color; /* 0x44 */ | ||
121 | + u32 m_control; /* 0x48 */ | ||
122 | + u32 bstamp_wss_data; /* 0x4C */ | ||
123 | + u32 s_carr; /* 0x50 */ | ||
124 | + u32 line21; /* 0x54 */ | ||
125 | + u32 ln_sel; /* 0x58 */ | ||
126 | + u32 l21__wc_ctl; /* 0x5C */ | ||
127 | + u32 htrigger_vtrigger; /* 0x60 */ | ||
128 | + u32 savid__eavid; /* 0x64 */ | ||
129 | + u32 flen__fal; /* 0x68 */ | ||
130 | + u32 lal__phase_reset; /* 0x6C */ | ||
131 | + u32 hs_int_start_stop_x; /* 0x70 */ | ||
132 | + u32 hs_ext_start_stop_x; /* 0x74 */ | ||
133 | + u32 vs_int_start_x; /* 0x78 */ | ||
134 | + u32 vs_int_stop_x__vs_int_start_y; /* 0x7C */ | ||
135 | + u32 vs_int_stop_y__vs_ext_start_x; /* 0x80 */ | ||
136 | + u32 vs_ext_stop_x__vs_ext_start_y; /* 0x84 */ | ||
137 | + u32 vs_ext_stop_y; /* 0x88 */ | ||
138 | + u32 reserve_3; /* 0x8C */ | ||
139 | + u32 avid_start_stop_x; /* 0x90 */ | ||
140 | + u32 avid_start_stop_y; /* 0x94 */ | ||
141 | + u32 reserve_4; /* 0x98 */ | ||
142 | + u32 reserve_5; /* 0x9C */ | ||
143 | + u32 fid_int_start_x__fid_int_start_y; /* 0xA0 */ | ||
144 | + u32 fid_int_offset_y__fid_ext_start_x; /* 0xA4 */ | ||
145 | + u32 fid_ext_start_y__fid_ext_offset_y; /* 0xA8 */ | ||
146 | + u32 reserve_6; /* 0xAC */ | ||
147 | + u32 tvdetgp_int_start_stop_x; /* 0xB0 */ | ||
148 | + u32 tvdetgp_int_start_stop_y; /* 0xB4 */ | ||
149 | + u32 gen_ctrl; /* 0xB8 */ | ||
150 | + u32 reserve_7; /* 0xBC */ | ||
151 | + u32 reserve_8; /* 0xC0 */ | ||
152 | + u32 output_control; /* 0xC4 */ | ||
153 | + u32 dac_b__dac_c; /* 0xC8 */ | ||
154 | + u32 height_width; /* 0xCC */ | ||
155 | +}; | ||
156 | + | ||
157 | +/* Few Register Offsets */ | ||
158 | +#define FRAME_MODE_SHIFT 1 | ||
159 | +#define TFTSTN_SHIFT 3 | ||
160 | +#define DATALINES_SHIFT 8 | ||
161 | + | ||
162 | +/* Enabling Display controller */ | ||
163 | +#define LCD_ENABLE 1 | ||
164 | +#define DIG_ENABLE (1 << 1) | ||
165 | +#define GO_LCD (1 << 5) | ||
166 | +#define GO_DIG (1 << 6) | ||
167 | +#define GP_OUT0 (1 << 15) | ||
168 | +#define GP_OUT1 (1 << 16) | ||
169 | + | ||
170 | +#define DISPC_ENABLE (LCD_ENABLE | \ | ||
171 | + DIG_ENABLE | \ | ||
172 | + GO_LCD | \ | ||
173 | + GO_DIG | \ | ||
174 | + GP_OUT0| \ | ||
175 | + GP_OUT1) | ||
176 | + | ||
177 | +/* Configure VENC DSS Params */ | ||
178 | +#define VENC_CLK_ENABLE (1 << 3) | ||
179 | +#define DAC_DEMEN (1 << 4) | ||
180 | +#define DAC_POWERDN (1 << 5) | ||
181 | +#define VENC_OUT_SEL (1 << 6) | ||
182 | +#define DIG_LPP_SHIFT 16 | ||
183 | +#define VENC_DSS_CONFIG (VENC_CLK_ENABLE | \ | ||
184 | + DAC_DEMEN | \ | ||
185 | + DAC_POWERDN | \ | ||
186 | + VENC_OUT_SEL) | ||
187 | +/* | ||
188 | + * Panel Configuration | ||
189 | + */ | ||
190 | +struct panel_config { | ||
191 | + u32 timing_h; | ||
192 | + u32 timing_v; | ||
193 | + u32 pol_freq; | ||
194 | + u32 divisor; | ||
195 | + u32 lcd_size; | ||
196 | + u32 panel_type; | ||
197 | + u32 data_lines; | ||
198 | + u32 load_mode; | ||
199 | + u32 panel_color; | ||
200 | +}; | ||
201 | + | ||
202 | +/* | ||
203 | + * Generic DSS Functions | ||
204 | + */ | ||
205 | +void omap3_dss_venc_config(const struct venc_regs *venc_cfg, | ||
206 | + u32 height, u32 width); | ||
207 | +void omap3_dss_panel_config(const struct panel_config *panel_cfg); | ||
208 | +void omap3_dss_enable(void); | ||
209 | + | ||
210 | +#endif /* DSS_H */ | ||
211 | diff --git a/drivers/video/omap3_dss.c b/drivers/video/omap3_dss.c | ||
212 | new file mode 100644 | ||
213 | index 0000000..69c705a | ||
214 | --- /dev/null | ||
215 | +++ b/drivers/video/omap3_dss.c | ||
216 | @@ -0,0 +1,130 @@ | ||
217 | +/* | ||
218 | + * (C) Copyright 2010 | ||
219 | + * Texas Instruments, <www.ti.com> | ||
220 | + * Syed Mohammed Khasim <khasim@ti.com> | ||
221 | + * | ||
222 | + * Referred to Linux DSS driver files for OMAP3 | ||
223 | + * | ||
224 | + * See file CREDITS for list of people who contributed to this | ||
225 | + * project. | ||
226 | + * | ||
227 | + * This program is free software; you can redistribute it and/or | ||
228 | + * modify it under the terms of the GNU General Public License as | ||
229 | + * published by the Free Software Foundation's version 2 of | ||
230 | + * the License. | ||
231 | + * | ||
232 | + * This program is distributed in the hope that it will be useful, | ||
233 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
234 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
235 | + * GNU General Public License for more details. | ||
236 | + * | ||
237 | + * You should have received a copy of the GNU General Public License | ||
238 | + * along with this program; if not, write to the Free Software | ||
239 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
240 | + * MA 02111-1307 USA | ||
241 | + */ | ||
242 | + | ||
243 | +#include <common.h> | ||
244 | +#include <asm/io.h> | ||
245 | +#include <asm/arch/dss.h> | ||
246 | + | ||
247 | +/* | ||
248 | + * Configure VENC for a given Mode (NTSC / PAL) | ||
249 | + */ | ||
250 | +void omap3_dss_venc_config(const struct venc_regs *venc_cfg, | ||
251 | + u32 height, u32 width) | ||
252 | +{ | ||
253 | + struct venc_regs *venc = (struct venc_regs *) OMAP3_VENC_BASE; | ||
254 | + struct dss_regs *dss = (struct dss_regs *) OMAP3_DSS_BASE; | ||
255 | + struct dispc_regs *dispc = (struct dispc_regs *) OMAP3_DISPC_BASE; | ||
256 | + | ||
257 | + writel(venc_cfg->status, &venc->status); | ||
258 | + writel(venc_cfg->f_control, &venc->f_control); | ||
259 | + writel(venc_cfg->vidout_ctrl, &venc->vidout_ctrl); | ||
260 | + writel(venc_cfg->sync_ctrl, &venc->sync_ctrl); | ||
261 | + writel(venc_cfg->llen, &venc->llen); | ||
262 | + writel(venc_cfg->flens, &venc->flens); | ||
263 | + writel(venc_cfg->hfltr_ctrl, &venc->hfltr_ctrl); | ||
264 | + writel(venc_cfg->cc_carr_wss_carr, &venc->cc_carr_wss_carr); | ||
265 | + writel(venc_cfg->c_phase, &venc->c_phase); | ||
266 | + writel(venc_cfg->gain_u, &venc->gain_u); | ||
267 | + writel(venc_cfg->gain_v, &venc->gain_v); | ||
268 | + writel(venc_cfg->gain_y, &venc->gain_y); | ||
269 | + writel(venc_cfg->black_level, &venc->black_level); | ||
270 | + writel(venc_cfg->blank_level, &venc->blank_level); | ||
271 | + writel(venc_cfg->x_color, &venc->x_color); | ||
272 | + writel(venc_cfg->m_control, &venc->m_control); | ||
273 | + writel(venc_cfg->bstamp_wss_data, &venc->bstamp_wss_data); | ||
274 | + writel(venc_cfg->s_carr, &venc->s_carr); | ||
275 | + writel(venc_cfg->line21, &venc->line21); | ||
276 | + writel(venc_cfg->ln_sel, &venc->ln_sel); | ||
277 | + writel(venc_cfg->l21__wc_ctl, &venc->l21__wc_ctl); | ||
278 | + writel(venc_cfg->htrigger_vtrigger, &venc->htrigger_vtrigger); | ||
279 | + writel(venc_cfg->savid__eavid, &venc->savid__eavid); | ||
280 | + writel(venc_cfg->flen__fal, &venc->flen__fal); | ||
281 | + writel(venc_cfg->lal__phase_reset, &venc->lal__phase_reset); | ||
282 | + writel(venc_cfg->hs_int_start_stop_x, | ||
283 | + &venc->hs_int_start_stop_x); | ||
284 | + writel(venc_cfg->hs_ext_start_stop_x, | ||
285 | + &venc->hs_ext_start_stop_x); | ||
286 | + writel(venc_cfg->vs_int_start_x, &venc->vs_int_start_x); | ||
287 | + writel(venc_cfg->vs_int_stop_x__vs_int_start_y, | ||
288 | + &venc->vs_int_stop_x__vs_int_start_y); | ||
289 | + writel(venc_cfg->vs_int_stop_y__vs_ext_start_x, | ||
290 | + &venc->vs_int_stop_y__vs_ext_start_x); | ||
291 | + writel(venc_cfg->vs_ext_stop_x__vs_ext_start_y, | ||
292 | + &venc->vs_ext_stop_x__vs_ext_start_y); | ||
293 | + writel(venc_cfg->vs_ext_stop_y, &venc->vs_ext_stop_y); | ||
294 | + writel(venc_cfg->avid_start_stop_x, &venc->avid_start_stop_x); | ||
295 | + writel(venc_cfg->avid_start_stop_y, &venc->avid_start_stop_y); | ||
296 | + writel(venc_cfg->fid_int_start_x__fid_int_start_y, | ||
297 | + &venc->fid_int_start_x__fid_int_start_y); | ||
298 | + writel(venc_cfg->fid_int_offset_y__fid_ext_start_x, | ||
299 | + &venc->fid_int_offset_y__fid_ext_start_x); | ||
300 | + writel(venc_cfg->fid_ext_start_y__fid_ext_offset_y, | ||
301 | + &venc->fid_ext_start_y__fid_ext_offset_y); | ||
302 | + writel(venc_cfg->tvdetgp_int_start_stop_x, | ||
303 | + &venc->tvdetgp_int_start_stop_x); | ||
304 | + writel(venc_cfg->tvdetgp_int_start_stop_y, | ||
305 | + &venc->tvdetgp_int_start_stop_y); | ||
306 | + writel(venc_cfg->gen_ctrl, &venc->gen_ctrl); | ||
307 | + writel(venc_cfg->output_control, &venc->output_control); | ||
308 | + writel(venc_cfg->dac_b__dac_c, &venc->dac_b__dac_c); | ||
309 | + | ||
310 | + /* Configure DSS for VENC Settings */ | ||
311 | + writel(VENC_DSS_CONFIG, &dss->control); | ||
312 | + | ||
313 | + /* Configure height and width for Digital out */ | ||
314 | + writel(((height << DIG_LPP_SHIFT) | width), &dispc->size_dig); | ||
315 | +} | ||
316 | + | ||
317 | +/* | ||
318 | + * Configure Panel Specific Parameters | ||
319 | + */ | ||
320 | +void omap3_dss_panel_config(const struct panel_config *panel_cfg) | ||
321 | +{ | ||
322 | + struct dispc_regs *dispc = (struct dispc_regs *) OMAP3_DISPC_BASE; | ||
323 | + | ||
324 | + writel(panel_cfg->timing_h, &dispc->timing_h); | ||
325 | + writel(panel_cfg->timing_v, &dispc->timing_v); | ||
326 | + writel(panel_cfg->pol_freq, &dispc->pol_freq); | ||
327 | + writel(panel_cfg->divisor, &dispc->divisor); | ||
328 | + writel(panel_cfg->lcd_size, &dispc->size_lcd); | ||
329 | + writel((panel_cfg->load_mode << FRAME_MODE_SHIFT), &dispc->config); | ||
330 | + writel(((panel_cfg->panel_type << TFTSTN_SHIFT) | | ||
331 | + (panel_cfg->data_lines << DATALINES_SHIFT)), &dispc->control); | ||
332 | + writel(panel_cfg->panel_color, &dispc->default_color0); | ||
333 | +} | ||
334 | + | ||
335 | +/* | ||
336 | + * Enable LCD and DIGITAL OUT in DSS | ||
337 | + */ | ||
338 | +void omap3_dss_enable(void) | ||
339 | +{ | ||
340 | + struct dispc_regs *dispc = (struct dispc_regs *) OMAP3_DISPC_BASE; | ||
341 | + u32 l = 0; | ||
342 | + | ||
343 | + l = readl(&dispc->control); | ||
344 | + l |= DISPC_ENABLE; | ||
345 | + writel(l, &dispc->control); | ||
346 | +} | ||
347 | -- | ||
348 | 1.6.6.1 | ||
349 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0020-video-DSS-makefile-update.patch b/recipes-bsp/u-boot/u-boot/2011.06/0020-video-DSS-makefile-update.patch new file mode 100644 index 00000000..045ebf6f --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0020-video-DSS-makefile-update.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | From ce6813c7f4006331dd661cd25178bb258d1e9469 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Kridner <jkridner@beagleboard.org> | ||
3 | Date: Tue, 19 Apr 2011 14:00:34 -0500 | ||
4 | Subject: [PATCH 20/30] video: DSS makefile update | ||
5 | |||
6 | Adding the OMAP3 DSS video driver to the Makefile. The patch applied to | ||
7 | u-boot-ti didn't include this for some reason. | ||
8 | |||
9 | Signed-off-by: Jason Kridner <jkridner@beagleboard.org> | ||
10 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
11 | --- | ||
12 | drivers/video/Makefile | 2 ++ | ||
13 | 1 files changed, 2 insertions(+), 0 deletions(-) | ||
14 | |||
15 | diff --git a/drivers/video/Makefile b/drivers/video/Makefile | ||
16 | index 086dc05..226684a 100644 | ||
17 | --- a/drivers/video/Makefile | ||
18 | +++ b/drivers/video/Makefile | ||
19 | @@ -41,6 +41,8 @@ COBJS-$(CONFIG_SED156X) += sed156x.o | ||
20 | COBJS-$(CONFIG_VIDEO_SM501) += sm501.o | ||
21 | COBJS-$(CONFIG_VIDEO_SMI_LYNXEM) += smiLynxEM.o videomodes.o | ||
22 | COBJS-$(CONFIG_VIDEO_VCXK) += bus_vcxk.o | ||
23 | +COBJS-$(CONFIG_VIDEO_OMAP3) += omap3_dss.o | ||
24 | +COBJS-y += videomodes.o | ||
25 | |||
26 | COBJS := $(COBJS-y) | ||
27 | SRCS := $(COBJS:.o=.c) | ||
28 | -- | ||
29 | 1.6.6.1 | ||
30 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0021-BeagleBoard-Configure-DVI-S-video.patch b/recipes-bsp/u-boot/u-boot/2011.06/0021-BeagleBoard-Configure-DVI-S-video.patch new file mode 100644 index 00000000..f8ab5a18 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0021-BeagleBoard-Configure-DVI-S-video.patch | |||
@@ -0,0 +1,170 @@ | |||
1 | From ebabfd9f1e6f712aafc2bba5ddfae530be4119ee Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Kridner <jkridner@beagleboard.org> | ||
3 | Date: Tue, 19 Apr 2011 14:01:13 -0500 | ||
4 | Subject: [PATCH 21/30] BeagleBoard: Configure DVI/S-video | ||
5 | |||
6 | Based on patches from Syed Mohammed Khasim (khasim@ti.com). | ||
7 | |||
8 | Configures the output of the BeagleBoard DVI to be orange. | ||
9 | Configures the output of the BeagleBoard S-Video to be a colorbar. | ||
10 | --- | ||
11 | Updates for this version | ||
12 | * Rebased on u-boot-ti. | ||
13 | |||
14 | v3 | ||
15 | * Rebased again. | ||
16 | |||
17 | Signed-off-by: Jason Kridner <jkridner@beagleboard.org> | ||
18 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
19 | --- | ||
20 | board/ti/beagle/beagle.c | 24 +++++++++++++ | ||
21 | board/ti/beagle/beagle.h | 86 ++++++++++++++++++++++++++++++++++++++++++++++ | ||
22 | 2 files changed, 110 insertions(+), 0 deletions(-) | ||
23 | |||
24 | diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c | ||
25 | index a290f89..39d9038 100644 | ||
26 | --- a/board/ti/beagle/beagle.c | ||
27 | +++ b/board/ti/beagle/beagle.c | ||
28 | @@ -164,6 +164,28 @@ unsigned int get_expansion_id(void) | ||
29 | } | ||
30 | |||
31 | /* | ||
32 | + * Configure DSS to display background color on DVID | ||
33 | + * Configure VENC to display color bar on S-Video | ||
34 | + */ | ||
35 | +void display_init(void) | ||
36 | +{ | ||
37 | + omap3_dss_venc_config(&venc_config_std_tv, VENC_HEIGHT, VENC_WIDTH); | ||
38 | + switch (get_board_revision()) { | ||
39 | + case REVISION_AXBX: | ||
40 | + case REVISION_CX: | ||
41 | + case REVISION_C4: | ||
42 | + omap3_dss_panel_config(&dvid_cfg); | ||
43 | + break; | ||
44 | + case REVISION_XM_A: | ||
45 | + case REVISION_XM_B: | ||
46 | + case REVISION_XM_C: | ||
47 | + default: | ||
48 | + omap3_dss_panel_config(&dvid_cfg_xm); | ||
49 | + break; | ||
50 | + } | ||
51 | +} | ||
52 | + | ||
53 | +/* | ||
54 | * Routine: misc_init_r | ||
55 | * Description: Configure board specific parts | ||
56 | */ | ||
57 | @@ -330,6 +352,8 @@ int misc_init_r(void) | ||
58 | GPIO15 | GPIO14 | GPIO13 | GPIO12), &gpio5_base->oe); | ||
59 | |||
60 | dieid_num_r(); | ||
61 | + display_init(); | ||
62 | + omap3_dss_enable(); | ||
63 | |||
64 | return 0; | ||
65 | } | ||
66 | diff --git a/board/ti/beagle/beagle.h b/board/ti/beagle/beagle.h | ||
67 | index 04247cd..18bfaa8 100644 | ||
68 | --- a/board/ti/beagle/beagle.h | ||
69 | +++ b/board/ti/beagle/beagle.h | ||
70 | @@ -23,6 +23,8 @@ | ||
71 | #ifndef _BEAGLE_H_ | ||
72 | #define _BEAGLE_H_ | ||
73 | |||
74 | +#include <asm/arch/dss.h> | ||
75 | + | ||
76 | const omap3_sysinfo sysinfo = { | ||
77 | DDR_STACKED, | ||
78 | "OMAP3 Beagle board", | ||
79 | @@ -472,4 +474,88 @@ const omap3_sysinfo sysinfo = { | ||
80 | MUX_VAL(CP(MMC2_DAT6), (IDIS | PTU | EN | M4)) /*GPIO_138 BT_EN*/\ | ||
81 | MUX_VAL(CP(MMC2_DAT7), (IDIS | PTU | EN | M4)) /*GPIO_139 WLAN_EN*/ | ||
82 | |||
83 | +/* | ||
84 | + * Display Configuration | ||
85 | + */ | ||
86 | + | ||
87 | +#define DVI_BEAGLE_ORANGE_COL 0x00FF8000 | ||
88 | +#define VENC_HEIGHT 0x00ef | ||
89 | +#define VENC_WIDTH 0x027f | ||
90 | + | ||
91 | +/* | ||
92 | + * Configure VENC in DSS for Beagle to generate Color Bar | ||
93 | + * | ||
94 | + * Kindly refer to OMAP TRM for definition of these values. | ||
95 | + */ | ||
96 | +static const struct venc_regs venc_config_std_tv = { | ||
97 | + .status = 0x0000001B, | ||
98 | + .f_control = 0x00000040, | ||
99 | + .vidout_ctrl = 0x00000000, | ||
100 | + .sync_ctrl = 0x00008000, | ||
101 | + .llen = 0x00008359, | ||
102 | + .flens = 0x0000020C, | ||
103 | + .hfltr_ctrl = 0x00000000, | ||
104 | + .cc_carr_wss_carr = 0x043F2631, | ||
105 | + .c_phase = 0x00000024, | ||
106 | + .gain_u = 0x00000130, | ||
107 | + .gain_v = 0x00000198, | ||
108 | + .gain_y = 0x000001C0, | ||
109 | + .black_level = 0x0000006A, | ||
110 | + .blank_level = 0x0000005C, | ||
111 | + .x_color = 0x00000000, | ||
112 | + .m_control = 0x00000001, | ||
113 | + .bstamp_wss_data = 0x0000003F, | ||
114 | + .s_carr = 0x21F07C1F, | ||
115 | + .line21 = 0x00000000, | ||
116 | + .ln_sel = 0x00000015, | ||
117 | + .l21__wc_ctl = 0x00001400, | ||
118 | + .htrigger_vtrigger = 0x00000000, | ||
119 | + .savid__eavid = 0x069300F4, | ||
120 | + .flen__fal = 0x0016020C, | ||
121 | + .lal__phase_reset = 0x00060107, | ||
122 | + .hs_int_start_stop_x = 0x008D034E, | ||
123 | + .hs_ext_start_stop_x = 0x000F0359, | ||
124 | + .vs_int_start_x = 0x01A00000, | ||
125 | + .vs_int_stop_x__vs_int_start_y = 0x020501A0, | ||
126 | + .vs_int_stop_y__vs_ext_start_x = 0x01AC0024, | ||
127 | + .vs_ext_stop_x__vs_ext_start_y = 0x020D01AC, | ||
128 | + .vs_ext_stop_y = 0x00000006, | ||
129 | + .avid_start_stop_x = 0x03480079, | ||
130 | + .avid_start_stop_y = 0x02040024, | ||
131 | + .fid_int_start_x__fid_int_start_y = 0x0001008A, | ||
132 | + .fid_int_offset_y__fid_ext_start_x = 0x01AC0106, | ||
133 | + .fid_ext_start_y__fid_ext_offset_y = 0x01060006, | ||
134 | + .tvdetgp_int_start_stop_x = 0x00140001, | ||
135 | + .tvdetgp_int_start_stop_y = 0x00010001, | ||
136 | + .gen_ctrl = 0x00FF0000, | ||
137 | + .output_control = 0x0000000D, | ||
138 | + .dac_b__dac_c = 0x00000000 | ||
139 | +}; | ||
140 | + | ||
141 | +/* | ||
142 | + * Configure Timings for DVI D | ||
143 | + */ | ||
144 | +static const struct panel_config dvid_cfg = { | ||
145 | + .timing_h = 0x0ff03f31, /* Horizantal timing */ | ||
146 | + .timing_v = 0x01400504, /* Vertical timing */ | ||
147 | + .pol_freq = 0x00007028, /* Pol Freq */ | ||
148 | + .divisor = 0x00010006, /* 72Mhz Pixel Clock */ | ||
149 | + .lcd_size = 0x02ff03ff, /* 1024x768 */ | ||
150 | + .panel_type = 0x01, /* TFT */ | ||
151 | + .data_lines = 0x03, /* 24 Bit RGB */ | ||
152 | + .load_mode = 0x02, /* Frame Mode */ | ||
153 | + .panel_color = DVI_BEAGLE_ORANGE_COL /* ORANGE */ | ||
154 | +}; | ||
155 | + | ||
156 | +static const struct panel_config dvid_cfg_xm = { | ||
157 | + .timing_h = 0x1a4024c9, /* Horizantal timing */ | ||
158 | + .timing_v = 0x02c00509, /* Vertical timing */ | ||
159 | + .pol_freq = 0x00007028, /* Pol Freq */ | ||
160 | + .divisor = 0x00010001, /* 96MHz Pixel Clock */ | ||
161 | + .lcd_size = 0x02ff03ff, /* 1024x768 */ | ||
162 | + .panel_type = 0x01, /* TFT */ | ||
163 | + .data_lines = 0x03, /* 24 Bit RGB */ | ||
164 | + .load_mode = 0x02, /* Frame Mode */ | ||
165 | + .panel_color = DVI_BEAGLE_ORANGE_COL /* ORANGE */ | ||
166 | +}; | ||
167 | #endif | ||
168 | -- | ||
169 | 1.6.6.1 | ||
170 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0022-BeagleBoard-config-enable-DSS.patch b/recipes-bsp/u-boot/u-boot/2011.06/0022-BeagleBoard-config-enable-DSS.patch new file mode 100644 index 00000000..295d401e --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0022-BeagleBoard-config-enable-DSS.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | From 79b347db36d583b0fde360baa780877b3a7ae754 Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Tue, 21 Jun 2011 22:18:01 +0200 | ||
4 | Subject: [PATCH 22/30] BeagleBoard: config: enable DSS | ||
5 | |||
6 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
7 | --- | ||
8 | include/configs/omap3_beagle.h | 1 + | ||
9 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
10 | |||
11 | diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h | ||
12 | index 5c32265..6c842ad 100644 | ||
13 | --- a/include/configs/omap3_beagle.h | ||
14 | +++ b/include/configs/omap3_beagle.h | ||
15 | @@ -172,6 +172,7 @@ | ||
16 | #define CONFIG_SYS_I2C_BUS_SELECT 1 | ||
17 | #define CONFIG_I2C_MULTI_BUS 1 | ||
18 | #define CONFIG_DRIVER_OMAP34XX_I2C 1 | ||
19 | +#define CONFIG_VIDEO_OMAP3 /* DSS Support */ | ||
20 | |||
21 | /* | ||
22 | * TWL4030 | ||
23 | -- | ||
24 | 1.6.6.1 | ||
25 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0023-BeagleBoard-Added-userbutton-command.patch b/recipes-bsp/u-boot/u-boot/2011.06/0023-BeagleBoard-Added-userbutton-command.patch new file mode 100644 index 00000000..4f91cebf --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0023-BeagleBoard-Added-userbutton-command.patch | |||
@@ -0,0 +1,107 @@ | |||
1 | From b6082310a74ef48b8c2c4c67092896563141a4ad Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Kridner <jkridner@beagleboard.org> | ||
3 | Date: Wed, 21 Jul 2010 07:41:25 -0500 | ||
4 | Subject: [PATCH 23/30] BeagleBoard: Added userbutton command | ||
5 | |||
6 | Based on commit f1099c7c43caf5bac3bf6a65aa266fade4747072 | ||
7 | Author: Greg Turner <gregturner@ti.com> | ||
8 | Date: Tue May 25 09:19:06 2010 -0500 | ||
9 | |||
10 | New u-boot command for status of USER button on BeagleBoard-xM | ||
11 | |||
12 | Modified bootcmd to check the staus at boot time and set | ||
13 | filename of the boot script. | ||
14 | |||
15 | * Moved to a BeagleBoard specific file. | ||
16 | * Removed changes to default boot command from adding userbutton | ||
17 | command. | ||
18 | * Made to handle pre-xM boards. | ||
19 | * Flipped polarity of the return value to avoid confusion. Success (0) | ||
20 | is when the button is pressed. Failure (1) is when the button is NOT | ||
21 | pressed. | ||
22 | * Used latest revision getting function. | ||
23 | * Used latest macros for board revision. | ||
24 | -- | ||
25 | v2 update: | ||
26 | * Added xM-C revision definition (optional, since it was default) | ||
27 | |||
28 | Signed-off-by: Jason Kridner <jkridner@beagleboard.org> | ||
29 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
30 | --- | ||
31 | board/ti/beagle/beagle.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++ | ||
32 | 1 files changed, 56 insertions(+), 0 deletions(-) | ||
33 | |||
34 | diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c | ||
35 | index 39d9038..4798194 100644 | ||
36 | --- a/board/ti/beagle/beagle.c | ||
37 | +++ b/board/ti/beagle/beagle.c | ||
38 | @@ -50,6 +50,7 @@ extern struct ehci_hccr *hccr; | ||
39 | extern volatile struct ehci_hcor *hcor; | ||
40 | #endif | ||
41 | #include "beagle.h" | ||
42 | +#include <command.h> | ||
43 | |||
44 | #define pr_debug(fmt, args...) debug(fmt, ##args) | ||
45 | |||
46 | @@ -477,3 +478,58 @@ int ehci_hcd_init(void) | ||
47 | } | ||
48 | |||
49 | #endif /* CONFIG_USB_EHCI */ | ||
50 | + | ||
51 | +/* | ||
52 | + * This command returns the status of the user button on beagle xM | ||
53 | + * Input - none | ||
54 | + * Returns - 1 if button is held down | ||
55 | + * 0 if button is not held down | ||
56 | + */ | ||
57 | +int do_userbutton (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) | ||
58 | +{ | ||
59 | + int button = 0; | ||
60 | + int gpio; | ||
61 | + | ||
62 | + /* | ||
63 | + * pass address parameter as argv[0] (aka command name), | ||
64 | + * and all remaining args | ||
65 | + */ | ||
66 | + switch (get_board_revision()) { | ||
67 | + case REVISION_AXBX: | ||
68 | + case REVISION_CX: | ||
69 | + case REVISION_C4: | ||
70 | + gpio = 7; | ||
71 | + break; | ||
72 | + case REVISION_XM_A: | ||
73 | + case REVISION_XM_B: | ||
74 | + case REVISION_XM_C: | ||
75 | + default: | ||
76 | + gpio = 4; | ||
77 | + break; | ||
78 | + } | ||
79 | + omap_request_gpio(gpio); | ||
80 | + omap_set_gpio_direction(gpio, 1); | ||
81 | + printf("The user button is currently "); | ||
82 | + if(omap_get_gpio_datain(gpio)) | ||
83 | + { | ||
84 | + button = 1; | ||
85 | + printf("PRESSED.\n"); | ||
86 | + } | ||
87 | + else | ||
88 | + { | ||
89 | + button = 0; | ||
90 | + printf("NOT pressed.\n"); | ||
91 | + } | ||
92 | + | ||
93 | + omap_free_gpio(gpio); | ||
94 | + | ||
95 | + return !button; | ||
96 | +} | ||
97 | + | ||
98 | +/* -------------------------------------------------------------------- */ | ||
99 | + | ||
100 | +U_BOOT_CMD( | ||
101 | + userbutton, CONFIG_SYS_MAXARGS, 1, do_userbutton, | ||
102 | + "Return the status of the BeagleBoard USER button", | ||
103 | + "" | ||
104 | +); | ||
105 | -- | ||
106 | 1.6.6.1 | ||
107 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0024-Corrected-LED-name-match-finding-avoiding-extraneous.patch b/recipes-bsp/u-boot/u-boot/2011.06/0024-Corrected-LED-name-match-finding-avoiding-extraneous.patch new file mode 100644 index 00000000..6bc3f6d7 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0024-Corrected-LED-name-match-finding-avoiding-extraneous.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | From 657f4308df123f3d2bd82c87bf667dd529d0f7c6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Kridner <jkridner@beagleboard.org> | ||
3 | Date: Tue, 8 Mar 2011 20:42:01 -0600 | ||
4 | Subject: [PATCH 24/30] Corrected LED name match finding avoiding extraneous Usage printouts | ||
5 | |||
6 | Signed-off-by: Jason Kridner <jkridner@beagleboard.org> | ||
7 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
8 | --- | ||
9 | common/cmd_led.c | 5 +++-- | ||
10 | 1 files changed, 3 insertions(+), 2 deletions(-) | ||
11 | |||
12 | diff --git a/common/cmd_led.c b/common/cmd_led.c | ||
13 | index c53195f..8b46848 100644 | ||
14 | --- a/common/cmd_led.c | ||
15 | +++ b/common/cmd_led.c | ||
16 | @@ -83,7 +83,7 @@ int str_onoff (char *var) | ||
17 | |||
18 | int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | ||
19 | { | ||
20 | - int state, i; | ||
21 | + int state, i, match = 0; | ||
22 | |||
23 | /* Validate arguments */ | ||
24 | if ((argc != 3)) { | ||
25 | @@ -98,6 +98,7 @@ int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | ||
26 | for (i = 0; led_commands[i].string; i++) { | ||
27 | if ((strcmp("all", argv[1]) == 0) || | ||
28 | (strcmp(led_commands[i].string, argv[1]) == 0)) { | ||
29 | + match = 1; | ||
30 | if (led_commands[i].on) { | ||
31 | if (state) { | ||
32 | led_commands[i].on(); | ||
33 | @@ -112,7 +113,7 @@ int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | ||
34 | } | ||
35 | |||
36 | /* If we ran out of matches, print Usage */ | ||
37 | - if (!led_commands[i].string && !(strcmp("all", argv[1]) == 0)) { | ||
38 | + if (!match) { | ||
39 | return cmd_usage(cmdtp); | ||
40 | } | ||
41 | |||
42 | -- | ||
43 | 1.6.6.1 | ||
44 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0025-BeagleBoard-fix-LED-0-1-in-driver.patch b/recipes-bsp/u-boot/u-boot/2011.06/0025-BeagleBoard-fix-LED-0-1-in-driver.patch new file mode 100644 index 00000000..92f9cddc --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0025-BeagleBoard-fix-LED-0-1-in-driver.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From c510bdc2684b5a755c4526071f1f3ca726ac1d1d Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Kridner <jkridner@beagleboard.org> | ||
3 | Date: Tue, 19 Apr 2011 10:55:26 -0500 | ||
4 | Subject: [PATCH 25/30] BeagleBoard: fix LED 0/1 in driver | ||
5 | |||
6 | Fixed USR0/USR1 to be LED 0/1 respectively | ||
7 | |||
8 | Signed-off-by: Jason Kridner <jkridner@beagleboard.org> | ||
9 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
10 | --- | ||
11 | board/ti/beagle/led.c | 4 ++-- | ||
12 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
13 | |||
14 | diff --git a/board/ti/beagle/led.c b/board/ti/beagle/led.c | ||
15 | index 08f95a0..d3de51f 100644 | ||
16 | --- a/board/ti/beagle/led.c | ||
17 | +++ b/board/ti/beagle/led.c | ||
18 | @@ -27,8 +27,8 @@ | ||
19 | static unsigned int saved_state[2] = {STATUS_LED_OFF, STATUS_LED_OFF}; | ||
20 | |||
21 | /* GPIO pins for the LEDs */ | ||
22 | -#define BEAGLE_LED_USR0 149 | ||
23 | -#define BEAGLE_LED_USR1 150 | ||
24 | +#define BEAGLE_LED_USR0 150 | ||
25 | +#define BEAGLE_LED_USR1 149 | ||
26 | |||
27 | #ifdef STATUS_LED_GREEN | ||
28 | void green_LED_off (void) | ||
29 | -- | ||
30 | 1.6.6.1 | ||
31 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0026-led-added-cmd_led-to-Makefile.patch b/recipes-bsp/u-boot/u-boot/2011.06/0026-led-added-cmd_led-to-Makefile.patch new file mode 100644 index 00000000..365ae69c --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0026-led-added-cmd_led-to-Makefile.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 6aac1cb7f47d7126be80df2e06042d37f1affce2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Kridner <jkridner@beagleboard.org> | ||
3 | Date: Wed, 20 Apr 2011 18:11:38 -0500 | ||
4 | Subject: [PATCH 26/30] led: added cmd_led to Makefile | ||
5 | |||
6 | Addition of cmd_led into the Makefile wasn't included in the patch | ||
7 | applied to u-boot-ti. | ||
8 | |||
9 | Signed-off-by: Jason Kridner <jkridner@beagleboard.org> | ||
10 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
11 | --- | ||
12 | common/Makefile | 1 + | ||
13 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
14 | |||
15 | diff --git a/common/Makefile b/common/Makefile | ||
16 | index 224b7cc..7445ccc 100644 | ||
17 | --- a/common/Makefile | ||
18 | +++ b/common/Makefile | ||
19 | @@ -107,6 +107,7 @@ COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o | ||
20 | COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o | ||
21 | COBJS-$(CONFIG_CMD_CRAMFS) += cmd_cramfs.o | ||
22 | COBJS-$(CONFIG_CMD_LDRINFO) += cmd_ldrinfo.o | ||
23 | +COBJS-$(CONFIG_CMD_LED) += cmd_led.o | ||
24 | COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o | ||
25 | COBJS-y += cmd_load.o | ||
26 | COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o | ||
27 | -- | ||
28 | 1.6.6.1 | ||
29 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0027-led-correct-off-on-locations-in-structure.patch b/recipes-bsp/u-boot/u-boot/2011.06/0027-led-correct-off-on-locations-in-structure.patch new file mode 100644 index 00000000..d0febf8e --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0027-led-correct-off-on-locations-in-structure.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From 48393aa0119882009df057c974f0dec6051eff79 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Kridner <jkridner@beagleboard.org> | ||
3 | Date: Wed, 20 Apr 2011 18:13:49 -0500 | ||
4 | Subject: [PATCH 27/30] led: correct off/on locations in structure | ||
5 | |||
6 | Although the initialization should probably be done with names, the | ||
7 | existing implementation has these structures filled in the opposite | ||
8 | order. | ||
9 | |||
10 | Signed-off-by: Jason Kridner <jkridner@beagleboard.org> | ||
11 | -- | ||
12 | v2 changes: | ||
13 | * Corrected comment as well. | ||
14 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
15 | --- | ||
16 | common/cmd_led.c | 4 ++-- | ||
17 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
18 | |||
19 | diff --git a/common/cmd_led.c b/common/cmd_led.c | ||
20 | index 8b46848..d14dd5a 100644 | ||
21 | --- a/common/cmd_led.c | ||
22 | +++ b/common/cmd_led.c | ||
23 | @@ -34,8 +34,8 @@ | ||
24 | struct led_tbl_s { | ||
25 | char *string; /* String for use in the command */ | ||
26 | led_id_t mask; /* Mask used for calling __led_set() */ | ||
27 | - void (*on)(void); /* Optional fucntion for turning LED on */ | ||
28 | - void (*off)(void); /* Optional fucntion for turning LED on */ | ||
29 | + void (*off)(void); /* Optional function for turning LED off */ | ||
30 | + void (*on)(void); /* Optional function for turning LED on */ | ||
31 | }; | ||
32 | |||
33 | typedef struct led_tbl_s led_tbl_t; | ||
34 | -- | ||
35 | 1.6.6.1 | ||
36 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0028-BeagleBoard-config-make-mtest-run.patch b/recipes-bsp/u-boot/u-boot/2011.06/0028-BeagleBoard-config-make-mtest-run.patch new file mode 100644 index 00000000..23cdc47b --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0028-BeagleBoard-config-make-mtest-run.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From 747f8f93a4e1d461340ddc04d3843d58565bab30 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Kridner <jkridner@beagleboard.org> | ||
3 | Date: Tue, 19 Apr 2011 11:58:54 -0500 | ||
4 | Subject: [PATCH 28/30] BeagleBoard: config: make mtest run | ||
5 | |||
6 | Utilize the alternate mtest and define a valid region. | ||
7 | |||
8 | Signed-off-by: Jason Kridner <jkridner@beagleboard.org> | ||
9 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
10 | --- | ||
11 | include/configs/omap3_beagle.h | 9 +++++---- | ||
12 | 1 files changed, 5 insertions(+), 4 deletions(-) | ||
13 | |||
14 | diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h | ||
15 | index 6c842ad..3bbc235 100644 | ||
16 | --- a/include/configs/omap3_beagle.h | ||
17 | +++ b/include/configs/omap3_beagle.h | ||
18 | @@ -292,10 +292,11 @@ | ||
19 | /* Boot Argument Buffer Size */ | ||
20 | #define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE) | ||
21 | |||
22 | -#define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0) /* memtest */ | ||
23 | - /* works on */ | ||
24 | -#define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \ | ||
25 | - 0x01F00000) /* 31MB */ | ||
26 | +#define CONFIG_SYS_ALT_MEMTEST 1 | ||
27 | +#define CONFIG_SYS_MEMTEST_START (0x82000000) /* memtest */ | ||
28 | + /* defaults */ | ||
29 | +#define CONFIG_SYS_MEMTEST_END (0x87FFFFFF) /* 128MB */ | ||
30 | +#define CONFIG_SYS_MEMTEST_SCRATCH (0x81000000) /* dummy address */ | ||
31 | |||
32 | #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0) /* default */ | ||
33 | /* load address */ | ||
34 | -- | ||
35 | 1.6.6.1 | ||
36 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0029-BeagleBoard-config-increase-command-line-functionali.patch b/recipes-bsp/u-boot/u-boot/2011.06/0029-BeagleBoard-config-increase-command-line-functionali.patch new file mode 100644 index 00000000..d7e2b3ad --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0029-BeagleBoard-config-increase-command-line-functionali.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From c75471405166cba2327680cc4e4d204f05007c54 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Kridner <jkridner@beagleboard.org> | ||
3 | Date: Tue, 19 Apr 2011 11:50:55 -0500 | ||
4 | Subject: [PATCH 29/30] BeagleBoard: config: increase command-line functionality | ||
5 | |||
6 | Enable the expression evaluator. | ||
7 | |||
8 | Signed-off-by: Jason Kridner <jkridner@beagleboard.org> | ||
9 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
10 | --- | ||
11 | include/configs/omap3_beagle.h | 5 +++-- | ||
12 | 1 files changed, 3 insertions(+), 2 deletions(-) | ||
13 | |||
14 | diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h | ||
15 | index 3bbc235..55973fb 100644 | ||
16 | --- a/include/configs/omap3_beagle.h | ||
17 | +++ b/include/configs/omap3_beagle.h | ||
18 | @@ -158,6 +158,7 @@ | ||
19 | #define CONFIG_CMD_NFS /* NFS support */ | ||
20 | #define CONFIG_CMD_PING | ||
21 | #define CONFIG_CMD_DHCP | ||
22 | +#define CONFIG_CMD_SETEXPR /* Evaluate expressions */ | ||
23 | |||
24 | #undef CONFIG_CMD_FLASH /* flinfo, erase, protect */ | ||
25 | #undef CONFIG_CMD_FPGA /* FPGA configuration Support */ | ||
26 | @@ -284,11 +285,11 @@ | ||
27 | #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */ | ||
28 | #define CONFIG_SYS_PROMPT_HUSH_PS2 "> " | ||
29 | #define CONFIG_SYS_PROMPT "OMAP3 beagleboard.org # " | ||
30 | -#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ | ||
31 | +#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */ | ||
32 | /* Print Buffer Size */ | ||
33 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ | ||
34 | sizeof(CONFIG_SYS_PROMPT) + 16) | ||
35 | -#define CONFIG_SYS_MAXARGS 16 /* max number of command args */ | ||
36 | +#define CONFIG_SYS_MAXARGS 32 /* max number of command args */ | ||
37 | /* Boot Argument Buffer Size */ | ||
38 | #define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE) | ||
39 | |||
40 | -- | ||
41 | 1.6.6.1 | ||
42 | |||
diff --git a/recipes-bsp/u-boot/u-boot/2011.06/0030-BeagleBoard-config-add-optargs-buddy-camera.patch b/recipes-bsp/u-boot/u-boot/2011.06/0030-BeagleBoard-config-add-optargs-buddy-camera.patch new file mode 100644 index 00000000..d8def033 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/2011.06/0030-BeagleBoard-config-add-optargs-buddy-camera.patch | |||
@@ -0,0 +1,51 @@ | |||
1 | From 0e384ea7bc94d8626c0280f7c0151f99fbc83008 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Kridner <jkridner@beagleboard.org> | ||
3 | Date: Tue, 19 Apr 2011 12:09:18 -0500 | ||
4 | Subject: [PATCH 30/30] BeagleBoard: config: add optargs/buddy/camera | ||
5 | |||
6 | buddy and camera are used to configure peripherals in the kernel at boot | ||
7 | time that cannot easily be detected by the kernel. | ||
8 | |||
9 | Signed-off-by: Jason Kridner <jkridner@beagleboard.org> | ||
10 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
11 | --- | ||
12 | include/configs/omap3_beagle.h | 6 ++++++ | ||
13 | 1 files changed, 6 insertions(+), 0 deletions(-) | ||
14 | |||
15 | diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h | ||
16 | index 55973fb..024cb9a 100644 | ||
17 | --- a/include/configs/omap3_beagle.h | ||
18 | +++ b/include/configs/omap3_beagle.h | ||
19 | @@ -214,6 +214,8 @@ | ||
20 | "console=ttyO2,115200n8\0" \ | ||
21 | "mpurate=auto\0" \ | ||
22 | "buddy=none "\ | ||
23 | + "optargs=\0" \ | ||
24 | + "camera=none\0" \ | ||
25 | "vram=12M\0" \ | ||
26 | "dvimode=1024x768MR-16@60\0" \ | ||
27 | "defaultdisplay=dvi\0" \ | ||
28 | @@ -223,16 +225,20 @@ | ||
29 | "nandroot=/dev/mtdblock4 rw\0" \ | ||
30 | "nandrootfstype=jffs2\0" \ | ||
31 | "mmcargs=setenv bootargs console=${console} " \ | ||
32 | + "${optargs} " \ | ||
33 | "mpurate=${mpurate} " \ | ||
34 | "buddy=${buddy} "\ | ||
35 | + "camera=${camera} "\ | ||
36 | "vram=${vram} " \ | ||
37 | "omapfb.mode=dvi:${dvimode} " \ | ||
38 | "omapdss.def_disp=${defaultdisplay} " \ | ||
39 | "root=${mmcroot} " \ | ||
40 | "rootfstype=${mmcrootfstype}\0" \ | ||
41 | "nandargs=setenv bootargs console=${console} " \ | ||
42 | + "${optargs} " \ | ||
43 | "mpurate=${mpurate} " \ | ||
44 | "buddy=${buddy} "\ | ||
45 | + "camera=${camera} "\ | ||
46 | "vram=${vram} " \ | ||
47 | "omapfb.mode=dvi:${dvimode} " \ | ||
48 | "omapdss.def_disp=${defaultdisplay} " \ | ||
49 | -- | ||
50 | 1.6.6.1 | ||
51 | |||
diff --git a/recipes-bsp/u-boot/u-boot_2011.06rc.bb b/recipes-bsp/u-boot/u-boot_2011.06rc.bb new file mode 100644 index 00000000..7f079515 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot_2011.06rc.bb | |||
@@ -0,0 +1,45 @@ | |||
1 | require u-boot.inc | ||
2 | |||
3 | # No patches for other machines yet | ||
4 | COMPATIBLE_MACHINE = "(beagleboard|omap4430-panda)" | ||
5 | |||
6 | SRC_URI = "git://www.denx.de/git/u-boot.git;protocol=git \ | ||
7 | file://2011.06/0001-OMAP3-Beagle-Pin-Mux-initialization-glitch-fix.patch \ | ||
8 | file://2011.06/0002-OMAP-Remove-omapfb.debug-y-from-Beagle-and-Overo-env.patch \ | ||
9 | file://2011.06/0003-OMAP3-beagle-pass-expansionboard-name-in-bootargs.patch \ | ||
10 | file://2011.06/0004-beagleboard-add-support-for-xM-revision-C.patch \ | ||
11 | file://2011.06/0005-Add-support-for-SMSC95XX-USB-2.0-10-100MBit-Ethernet.patch \ | ||
12 | file://2011.06/0006-Add-Ethernet-hardware-MAC-address-framework-to-usbne.patch \ | ||
13 | file://2011.06/0007-Add-documentation-for-USB-Host-Networking.patch \ | ||
14 | file://2011.06/0008-dm3730-enable-dpll5.patch \ | ||
15 | file://2011.06/0009-beagleboard-enable-HUB-power-on-XM-boards.patch \ | ||
16 | file://2011.06/0010-beagleboard-turn-off-clocks-in-ehci_stop.patch \ | ||
17 | file://2011.06/0011-beagleboard-enable-networking.patch \ | ||
18 | file://2011.06/0012-beagleboard-switch-to-ttyO2-as-console.patch \ | ||
19 | file://2011.06/0013-beagleboard-load-kernel-from-MMC-ext-not-FAT.patch \ | ||
20 | file://2011.06/0014-beagleboard-enable-asix-driver-and-dhcp.patch \ | ||
21 | file://2011.06/0015-beagleboard-hardcode-MAC-for-onboard-SMSC-and-use-uI.patch \ | ||
22 | file://2011.06/0016-beagleboard-decrease-bootdelay-to-2-seconds.patch \ | ||
23 | file://2011.06/0017-USB-Remove-__attribute__-packed-for-struct-ehci_hccr.patch \ | ||
24 | file://2011.06/0018-usb-Some-EHCI-chipsets-are-slow-to-respond.patch \ | ||
25 | file://2011.06/0019-OMAP3-Add-DSS-driver-for-OMAP3.patch \ | ||
26 | file://2011.06/0020-video-DSS-makefile-update.patch \ | ||
27 | file://2011.06/0021-BeagleBoard-Configure-DVI-S-video.patch \ | ||
28 | file://2011.06/0022-BeagleBoard-config-enable-DSS.patch \ | ||
29 | file://2011.06/0023-BeagleBoard-Added-userbutton-command.patch \ | ||
30 | file://2011.06/0024-Corrected-LED-name-match-finding-avoiding-extraneous.patch \ | ||
31 | file://2011.06/0025-BeagleBoard-fix-LED-0-1-in-driver.patch \ | ||
32 | file://2011.06/0026-led-added-cmd_led-to-Makefile.patch \ | ||
33 | file://2011.06/0027-led-correct-off-on-locations-in-structure.patch \ | ||
34 | file://2011.06/0028-BeagleBoard-config-make-mtest-run.patch \ | ||
35 | file://2011.06/0029-BeagleBoard-config-increase-command-line-functionali.patch \ | ||
36 | file://2011.06/0030-BeagleBoard-config-add-optargs-buddy-camera.patch \ | ||
37 | file://fw_env.config \ | ||
38 | " | ||
39 | |||
40 | SRCREV = "9623c158f6a5150a21c25026bfba79e7ff7912f5" | ||
41 | PV = "2011.03+2011.06rc2+${PR}+gitr${SRCREV}" | ||
42 | |||
43 | LIC_FILES_CHKSUM = "file://COPYING;md5=1707d6db1d42237583f50183a5651ecb" | ||
44 | |||
45 | S = "${WORKDIR}/git" | ||