pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

u-boot-omap4-panda: add u-boot-omap4-panda-2021.01



Module Name:	pkgsrc-wip
Committed By:	Rui-Xiang Guo <rxg%lavabit.com@localhost>
Pushed By:	rxg
Date:		Fri May 9 15:42:36 2025 +0800
Changeset:	2fcb343834cd08ed7669dbe56f87ca29c980a7ff

Modified Files:
	Makefile
Added Files:
	u-boot-omap4-panda/DESCR
	u-boot-omap4-panda/Makefile
	u-boot-omap4-panda/PLIST
	u-boot-omap4-panda/files/installboot.plist
	u-boot-omap4-panda/patches/patch-drivers_usb_host_ehci-hcd.c

Log Message:
u-boot-omap4-panda: add u-boot-omap4-panda-2021.01

This package is from sysutils/u-boot-pandaboard but uses legacy methods to
enable smsc9514 chip.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=2fcb343834cd08ed7669dbe56f87ca29c980a7ff

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                           |  1 +
 u-boot-omap4-panda/DESCR                           |  5 ++
 u-boot-omap4-panda/Makefile                        | 21 +++++++
 u-boot-omap4-panda/PLIST                           |  4 ++
 u-boot-omap4-panda/files/installboot.plist         | 73 ++++++++++++++++++++++
 .../patches/patch-drivers_usb_host_ehci-hcd.c      | 49 +++++++++++++++
 6 files changed, 153 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 1e04797a04..74b160316f 100644
--- a/Makefile
+++ b/Makefile
@@ -5785,6 +5785,7 @@ SUBDIR+=	u-boot-full
 SUBDIR+=	u-boot-khadas-vim3
 SUBDIR+=	u-boot-mangopi-mq-pro
 SUBDIR+=	u-boot-nanopi-r2s
+SUBDIR+=	u-boot-omap4-panda
 SUBDIR+=	u-boot-orangepi-pc2
 SUBDIR+=	u-boot-pinebook-crust
 SUBDIR+=	u-boot-rock5b
diff --git a/u-boot-omap4-panda/DESCR b/u-boot-omap4-panda/DESCR
new file mode 100644
index 0000000000..262052a2aa
--- /dev/null
+++ b/u-boot-omap4-panda/DESCR
@@ -0,0 +1,5 @@
+U-Boot is a bootloader for embedded boards based on PowerPC, ARM, MIPS and
+several other processors, which can be installed in a boot ROM and used to
+initialize and test the hardware or to download and run application code.
+
+This package provides U-Boot for the OMAP4-based PandaBoard series.
diff --git a/u-boot-omap4-panda/Makefile b/u-boot-omap4-panda/Makefile
new file mode 100644
index 0000000000..9714119aaa
--- /dev/null
+++ b/u-boot-omap4-panda/Makefile
@@ -0,0 +1,21 @@
+# $NetBSD$
+
+UBOOT_TARGET=		omap4-panda
+UBOOT_CONFIG=		omap4_panda_defconfig
+UBOOT_BIN=		MLO u-boot.img
+
+UBOOT_VERSION=		2021.01
+
+UBOOT_INSTALLBOOT_PLIST=	installboot.plist
+
+post-patch:
+	cd ${WRKSRC}; \
+	for f in ${.CURDIR}/patches/patch-*; do \
+		${PATCH} -p0 < $$f; \
+	done
+	${ECHO} 'CONFIG_DM_ETH=n' >> ${WRKSRC}/configs/${UBOOT_CONFIG}
+	${ECHO} 'CONFIG_DM_USB=n' >> ${WRKSRC}/configs/${UBOOT_CONFIG}
+	${ECHO} 'CONFIG_TWL6030_POWER=y' >> ${WRKSRC}/configs/${UBOOT_CONFIG}
+
+.include "../../sysutils/u-boot/u-boot-arm.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/u-boot-omap4-panda/PLIST b/u-boot-omap4-panda/PLIST
new file mode 100644
index 0000000000..b12791a192
--- /dev/null
+++ b/u-boot-omap4-panda/PLIST
@@ -0,0 +1,4 @@
+@comment $NetBSD$
+share/u-boot/omap4-panda/MLO
+share/u-boot/omap4-panda/installboot.plist
+share/u-boot/omap4-panda/u-boot.img
diff --git a/u-boot-omap4-panda/files/installboot.plist b/u-boot-omap4-panda/files/installboot.plist
new file mode 100644
index 0000000000..c50646b6d6
--- /dev/null
+++ b/u-boot-omap4-panda/files/installboot.plist
@@ -0,0 +1,73 @@
+<!-- $NetBSD: installboot.plist,v 1.1 2020/06/21 03:27:58 thorpej Exp $ -->
+<!--
+  Copyright (c) 2019 The NetBSD Foundation, Inc.
+  All rights reserved.
+ 
+  This code is derived from software contributed to The NetBSD Foundation
+  by Jason R. Thorpe.
+ 
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+  PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  POSSIBILITY OF SUCH DAMAGE.
+-->
+<plist>
+<dict>
+	<key>ti,omap4-panda</key>
+	<dict>
+		<key>description</key>
+		<string>TI OMAP4 PandaBoard</string>
+		<key>u-boot-install</key>
+		<array>
+			<dict>
+				<key>file-name</key>
+				<string>MLO</string>
+				<key>image-offset</key>
+				<integer>131072</integer>
+			</dict>
+			<dict>
+				<key>file-name</key>
+				<string>u-boot.img</string>
+				<key>image-offset</key>
+				<integer>393216</integer>
+			</dict>
+		</array>
+	</dict>
+	<key>ti,omap4-panda-es</key>
+	<dict>
+		<key>description</key>
+		<string>TI OMAP4 PandaBoard-ES</string>
+		<key>u-boot-install</key>
+		<array>
+			<dict>
+				<key>file-name</key>
+				<string>MLO</string>
+				<key>image-offset</key>
+				<integer>131072</integer>
+			</dict>
+			<dict>
+				<key>file-name</key>
+				<string>u-boot.img</string>
+				<key>image-offset</key>
+				<integer>393216</integer>
+			</dict>
+		</array>
+	</dict>
+</dict>
+</plist>
diff --git a/u-boot-omap4-panda/patches/patch-drivers_usb_host_ehci-hcd.c b/u-boot-omap4-panda/patches/patch-drivers_usb_host_ehci-hcd.c
new file mode 100644
index 0000000000..d783b2766c
--- /dev/null
+++ b/u-boot-omap4-panda/patches/patch-drivers_usb_host_ehci-hcd.c
@@ -0,0 +1,49 @@
+$NetBSD$
+
+--- drivers/usb/host/ehci-hcd.c.orig	2025-05-03 07:57:06.649117012 +0000
++++ drivers/usb/host/ehci-hcd.c
+@@ -15,6 +15,8 @@
+ #include <asm/cache.h>
+ #include <asm/unaligned.h>
+ #include <usb.h>
++#include <asm/arch/ehci.h>
++#include <asm/ehci-omap.h>
+ #include <asm/io.h>
+ #include <malloc.h>
+ #include <memalign.h>
+@@ -1132,6 +1134,35 @@ static int ehci_common_init(struct ehci_
+ }
+ 
+ #if !CONFIG_IS_ENABLED(DM_USB)
++static struct omap_usbhs_board_data usbhs_bdata = {
++	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
++	.port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
++	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
++};
++
++int ehci_hcd_init(int index, enum usb_init_type init,
++		struct ehci_hccr **hccr, struct ehci_hcor **hcor)
++{
++	int ret;
++	unsigned int utmi_clk;
++
++	/* Now we can enable our port clocks */
++	utmi_clk = readl((void *)CM_L3INIT_HSUSBHOST_CLKCTRL);
++	utmi_clk |= HSUSBHOST_CLKCTRL_CLKSEL_UTMI_P1_MASK;
++	setbits_le32((void *)CM_L3INIT_HSUSBHOST_CLKCTRL, utmi_clk);
++
++	ret = omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
++	if (ret < 0)
++		return ret;
++
++	return 0;
++}
++
++int ehci_hcd_stop(int index)
++{
++	return omap_ehci_hcd_stop();
++}
++
+ int usb_lowlevel_stop(int index)
+ {
+ 	ehci_shutdown(&ehcic[index]);


Home | Main Index | Thread Index | Old Index