aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/uboot-oxnas/patches
diff options
context:
space:
mode:
Diffstat (limited to 'package/boot/uboot-oxnas/patches')
-rw-r--r--package/boot/uboot-oxnas/patches/010-capacity-is-unsigned.patch42
-rw-r--r--package/boot/uboot-oxnas/patches/150-spl-block.patch54
-rw-r--r--package/boot/uboot-oxnas/patches/200-icplus-phy.patch142
-rw-r--r--package/boot/uboot-oxnas/patches/300-oxnas-target.patch101
-rw-r--r--package/boot/uboot-oxnas/patches/800-fix-bootm-assertion.patch11
5 files changed, 350 insertions, 0 deletions
diff --git a/package/boot/uboot-oxnas/patches/010-capacity-is-unsigned.patch b/package/boot/uboot-oxnas/patches/010-capacity-is-unsigned.patch
new file mode 100644
index 0000000..3990aa9
--- /dev/null
+++ b/package/boot/uboot-oxnas/patches/010-capacity-is-unsigned.patch
@@ -0,0 +1,42 @@
+From df9fb90120423c4c55b66a5dc09af23f605a406b Mon Sep 17 00:00:00 2001
+From: Daniel Golle <daniel@makrotopia.org>
+Date: Mon, 1 Dec 2014 21:37:25 +0100
+Subject: [PATCH] disk/part.c: use unsigned format when printing capacity
+To: u-boot@lists.denx.de
+
+Large disks otherwise produce highly unplausible output such as
+ Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)
+
+As supposedly all size-related decimals are unsigned, use unsigned
+format in printf statement, resulting in a correct capacity being
+displayed:
+ Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512)
+
+Signed-off-by: Daniel Golle <daniel@makrotopia.org>
+---
+ disk/part.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/disk/part.c b/disk/part.c
+index 43485c9..7c67ea6 100644
+--- a/disk/part.c
++++ b/disk/part.c
+@@ -229,13 +229,13 @@ void dev_print (block_dev_desc_t *dev_desc)
+ printf (" Supports 48-bit addressing\n");
+ #endif
+ #if defined(CONFIG_SYS_64BIT_LBA)
+- printf (" Capacity: %ld.%ld MB = %ld.%ld GB (%Ld x %ld)\n",
++ printf (" Capacity: %lu.%lu MB = %lu.%lu GB (%Lu x %lu)\n",
+ mb_quot, mb_rem,
+ gb_quot, gb_rem,
+ lba,
+ dev_desc->blksz);
+ #else
+- printf (" Capacity: %ld.%ld MB = %ld.%ld GB (%ld x %ld)\n",
++ printf (" Capacity: %lu.%lu MB = %lu.%lu GB (%lu x %lu)\n",
+ mb_quot, mb_rem,
+ gb_quot, gb_rem,
+ (ulong)lba,
+--
+2.1.3
+
diff --git a/package/boot/uboot-oxnas/patches/150-spl-block.patch b/package/boot/uboot-oxnas/patches/150-spl-block.patch
new file mode 100644
index 0000000..5d76084
--- /dev/null
+++ b/package/boot/uboot-oxnas/patches/150-spl-block.patch
@@ -0,0 +1,54 @@
+--- a/common/spl/Makefile
++++ b/common/spl/Makefile
+@@ -19,4 +19,5 @@ obj-$(CONFIG_SPL_MMC_SUPPORT) += spl_mmc
+ obj-$(CONFIG_SPL_USB_SUPPORT) += spl_usb.o
+ obj-$(CONFIG_SPL_FAT_SUPPORT) += spl_fat.o
+ obj-$(CONFIG_SPL_SATA_SUPPORT) += spl_sata.o
++obj-$(CONFIG_SPL_BLOCK_SUPPORT) += spl_block.o
+ endif
+--- a/common/spl/spl.c
++++ b/common/spl/spl.c
+@@ -191,6 +191,14 @@ void board_init_r(gd_t *dummy1, ulong du
+ spl_spi_load_image();
+ break;
+ #endif
++#ifdef CONFIG_SPL_BLOCK_SUPPORT
++ case BOOT_DEVICE_BLOCK:
++ {
++ extern void spl_block_load_image(void);
++ spl_block_load_image();
++ break;
++ }
++#endif
+ #ifdef CONFIG_SPL_ETH_SUPPORT
+ case BOOT_DEVICE_CPGMAC:
+ #ifdef CONFIG_SPL_ETH_DEVICE
+--- a/common/cmd_nvedit.c
++++ b/common/cmd_nvedit.c
+@@ -49,6 +49,7 @@ DECLARE_GLOBAL_DATA_PTR;
+ !defined(CONFIG_ENV_IS_IN_SPI_FLASH) && \
+ !defined(CONFIG_ENV_IS_IN_REMOTE) && \
+ !defined(CONFIG_ENV_IS_IN_UBI) && \
++ !defined(CONFIG_ENV_IS_IN_EXT4) && \
+ !defined(CONFIG_ENV_IS_NOWHERE)
+ # error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|DATAFLASH|ONENAND|\
+ SPI_FLASH|NVRAM|MMC|FAT|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE
+--- a/common/Makefile
++++ b/common/Makefile
+@@ -63,6 +63,7 @@ obj-$(CONFIG_ENV_IS_IN_ONENAND) += env_o
+ obj-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
+ obj-$(CONFIG_ENV_IS_IN_REMOTE) += env_remote.o
+ obj-$(CONFIG_ENV_IS_IN_UBI) += env_ubi.o
++obj-$(CONFIG_ENV_IS_IN_EXT4) += env_ext4.o
+ obj-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
+
+ # command
+@@ -213,6 +214,8 @@ obj-$(CONFIG_UPDATE_TFTP) += update.o
+ obj-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
+ obj-$(CONFIG_CMD_DFU) += cmd_dfu.o
+ obj-$(CONFIG_CMD_GPT) += cmd_gpt.o
++else
++obj-$(CONFIG_SPL_BLOCK_SUPPORT) += cmd_ide.o
+ endif
+
+ ifdef CONFIG_SPL_BUILD
diff --git a/package/boot/uboot-oxnas/patches/200-icplus-phy.patch b/package/boot/uboot-oxnas/patches/200-icplus-phy.patch
new file mode 100644
index 0000000..b378331
--- /dev/null
+++ b/package/boot/uboot-oxnas/patches/200-icplus-phy.patch
@@ -0,0 +1,142 @@
+From e719404ee1241af679a51879eaad291bc27e4817 Mon Sep 17 00:00:00 2001
+From: Daniel Golle <daniel@makrotopia.org>
+Date: Tue, 2 Dec 2014 14:46:05 +0100
+Subject: [PATCH] net/phy: add back icplus driver
+
+IC+ phy driver was removed due to the lack of users some time ago.
+Add it back, so we can use it.
+---
+ drivers/net/phy/Makefile | 1 +
+ drivers/net/phy/icplus.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++
+ drivers/net/phy/phy.c | 3 ++
+ 3 files changed, 84 insertions(+)
+ create mode 100644 drivers/net/phy/icplus.c
+
+--- a/drivers/net/phy/Makefile
++++ b/drivers/net/phy/Makefile
+@@ -15,6 +15,7 @@ obj-$(CONFIG_PHY_ATHEROS) += atheros.o
+ obj-$(CONFIG_PHY_BROADCOM) += broadcom.o
+ obj-$(CONFIG_PHY_DAVICOM) += davicom.o
+ obj-$(CONFIG_PHY_ET1011C) += et1011c.o
++obj-$(CONFIG_PHY_ICPLUS) += icplus.o
+ obj-$(CONFIG_PHY_LXT) += lxt.o
+ obj-$(CONFIG_PHY_MARVELL) += marvell.o
+ obj-$(CONFIG_PHY_MICREL) += micrel.o
+--- /dev/null
++++ b/drivers/net/phy/icplus.c
+@@ -0,0 +1,93 @@
++/*
++ * ICPlus PHY drivers
++ *
++ * SPDX-License-Identifier: GPL-2.0+
++ *
++ * Copyright (c) 2007 Freescale Semiconductor, Inc.
++ */
++#include <phy.h>
++
++/* IP101A/G - IP1001 */
++#define IP10XX_SPEC_CTRL_STATUS 16 /* Spec. Control Register */
++#define IP1001_SPEC_CTRL_STATUS_2 20 /* IP1001 Spec. Control Reg 2 */
++#define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */
++#define IP1001_APS_ON 11 /* IP1001 APS Mode bit */
++#define IP101A_G_APS_ON 2 /* IP101A/G APS Mode bit */
++#define IP101A_G_IRQ_CONF_STATUS 0x11 /* Conf Info IRQ & Status Reg */
++#define IP101A_G_IRQ_PIN_USED (1<<15) /* INTR pin used */
++#define IP101A_G_IRQ_DEFAULT IP101A_G_IRQ_PIN_USED
++#define IP1001LF_DRIVE_MASK (15 << 5)
++#define IP1001LF_RXCLKDRIVE_HI (2 << 5)
++#define IP1001LF_RXDDRIVE_HI (2 << 7)
++#define IP1001LF_RXCLKDRIVE_M (1 << 5)
++#define IP1001LF_RXDDRIVE_M (1 << 7)
++#define IP1001LF_RXCLKDRIVE_L (0 << 5)
++#define IP1001LF_RXDDRIVE_L (0 << 7)
++#define IP1001LF_RXCLKDRIVE_VL (3 << 5)
++#define IP1001LF_RXDDRIVE_VL (3 << 7)
++
++static int ip1001_config(struct phy_device *phydev)
++{
++ int c;
++
++ /* Enable Auto Power Saving mode */
++ c = phy_read(phydev, MDIO_DEVAD_NONE, IP1001_SPEC_CTRL_STATUS_2);
++ if (c < 0)
++ return c;
++ c |= IP1001_APS_ON;
++ c = phy_write(phydev, MDIO_DEVAD_NONE, IP1001_SPEC_CTRL_STATUS_2, c);
++ if (c < 0)
++ return c;
++
++ /* INTR pin used: speed/link/duplex will cause an interrupt */
++ c = phy_write(phydev, MDIO_DEVAD_NONE, IP101A_G_IRQ_CONF_STATUS,
++ IP101A_G_IRQ_DEFAULT);
++ if (c < 0)
++ return c;
++
++ if (phydev->interface == PHY_INTERFACE_MODE_RGMII) {
++ /*
++ * Additional delay (2ns) used to adjust RX clock phase
++ * at RGMII interface
++ */
++ c = phy_read(phydev, MDIO_DEVAD_NONE, IP10XX_SPEC_CTRL_STATUS);
++ if (c < 0)
++ return c;
++
++ c |= IP1001_PHASE_SEL_MASK;
++ /* adjust digtial drive strength */
++ c &= ~IP1001LF_DRIVE_MASK;
++ c |= IP1001LF_RXCLKDRIVE_M;
++ c |= IP1001LF_RXDDRIVE_M;
++ c = phy_write(phydev, MDIO_DEVAD_NONE, IP10XX_SPEC_CTRL_STATUS,
++ c);
++ if (c < 0)
++ return c;
++ }
++
++ return 0;
++}
++
++static int ip1001_startup(struct phy_device *phydev)
++{
++ genphy_update_link(phydev);
++ genphy_parse_link(phydev);
++
++ return 0;
++}
++static struct phy_driver IP1001_driver = {
++ .name = "ICPlus IP1001",
++ .uid = 0x02430d90,
++ .mask = 0x0ffffff0,
++ .features = PHY_GBIT_FEATURES,
++ .config = &ip1001_config,
++ .startup = &ip1001_startup,
++ .shutdown = &genphy_shutdown,
++};
++
++int phy_icplus_init(void)
++{
++ phy_register(&IP1001_driver);
++
++ return 0;
++}
+--- a/drivers/net/phy/phy.c
++++ b/drivers/net/phy/phy.c
+@@ -454,6 +454,9 @@ int phy_init(void)
+ #ifdef CONFIG_PHY_ET1011C
+ phy_et1011c_init();
+ #endif
++#ifdef CONFIG_PHY_ICPLUS
++ phy_icplus_init();
++#endif
+ #ifdef CONFIG_PHY_LXT
+ phy_lxt_init();
+ #endif
+--- a/include/phy.h
++++ b/include/phy.h
+@@ -225,6 +225,7 @@ int phy_atheros_init(void);
+ int phy_broadcom_init(void);
+ int phy_davicom_init(void);
+ int phy_et1011c_init(void);
++int phy_icplus_init(void);
+ int phy_lxt_init(void);
+ int phy_marvell_init(void);
+ int phy_micrel_init(void);
diff --git a/package/boot/uboot-oxnas/patches/300-oxnas-target.patch b/package/boot/uboot-oxnas/patches/300-oxnas-target.patch
new file mode 100644
index 0000000..44e5842
--- /dev/null
+++ b/package/boot/uboot-oxnas/patches/300-oxnas-target.patch
@@ -0,0 +1,101 @@
+--- a/arch/arm/include/asm/mach-types.h
++++ b/arch/arm/include/asm/mach-types.h
+@@ -212,6 +212,7 @@ extern unsigned int __machine_arch_type;
+ #define MACH_TYPE_EDB9307A 1128
+ #define MACH_TYPE_OMAP_3430SDP 1138
+ #define MACH_TYPE_VSTMS 1140
++#define MACH_TYPE_OXNAS 1152
+ #define MACH_TYPE_MICRO9M 1169
+ #define MACH_TYPE_BUG 1179
+ #define MACH_TYPE_AT91SAM9263EK 1202
+--- a/drivers/block/Makefile
++++ b/drivers/block/Makefile
+@@ -21,3 +21,4 @@ obj-$(CONFIG_IDE_SIL680) += sil680.o
+ obj-$(CONFIG_SANDBOX) += sandbox.o
+ obj-$(CONFIG_SCSI_SYM53C8XX) += sym53c8xx.o
+ obj-$(CONFIG_SYSTEMACE) += systemace.o
++obj-$(CONFIG_IDE_PLX) += plxsata_ide.o
+--- a/drivers/usb/host/Makefile
++++ b/drivers/usb/host/Makefile
+@@ -33,6 +33,7 @@ obj-$(CONFIG_USB_EHCI_MX6) += ehci-mx6.o
+ obj-$(CONFIG_USB_EHCI_OMAP) += ehci-omap.o
+ obj-$(CONFIG_USB_EHCI_PPC4XX) += ehci-ppc4xx.o
+ obj-$(CONFIG_USB_EHCI_MARVELL) += ehci-marvell.o
++obj-$(CONFIG_USB_EHCI_OXNAS) += ehci-oxnas.o
+ obj-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o
+ obj-$(CONFIG_USB_EHCI_SPEAR) += ehci-spear.o
+ obj-$(CONFIG_USB_EHCI_SUNXI) += ehci-sunxi.o
+--- a/tools/.gitignore
++++ b/tools/.gitignore
+@@ -9,6 +9,7 @@
+ /mkenvimage
+ /mkimage
+ /mkexynosspl
++/mkox820crc
+ /mpc86x_clk
+ /mxsboot
+ /mksunxiboot
+--- a/tools/Makefile
++++ b/tools/Makefile
+@@ -143,6 +143,12 @@ hostprogs-$(CONFIG_KIRKWOOD) += kwboot
+ hostprogs-y += proftool
+ hostprogs-$(CONFIG_STATIC_RELA) += relocate-rela
+
++
++hostprogs-$(CONFIG_OX820) += mkox820crc$(SFX)
++
++mkox820crc$(SFX)-objs := mkox820crc.o lib/crc32.o
++
++
+ # We build some files with extra pedantic flags to try to minimize things
+ # that won't build on some weird host compiler -- though there are lots of
+ # exceptions for files that aren't complaint.
+--- a/drivers/serial/ns16550.c
++++ b/drivers/serial/ns16550.c
+@@ -118,6 +118,14 @@ int ns16550_calc_divisor(NS16550_t port,
+ }
+ port->osc_12m_sel = 0; /* clear if previsouly set */
+ #endif
++#ifdef CONFIG_OX820
++ {
++ /* with additional 3 bit fractional */
++ u32 div = (CONFIG_SYS_NS16550_CLK + baudrate) / (baudrate * 2);
++ port->reg9 = (div & 7) << 5;
++ return (div >> 3);
++ }
++#endif
+
+ return DIV_ROUND_CLOSEST(clock, mode_x_div * baudrate);
+ }
+--- a/scripts/Makefile.spl
++++ b/scripts/Makefile.spl
+@@ -202,6 +202,9 @@ OBJCOPYFLAGS_$(SPL_BIN).bin = $(SPL_OBJC
+
+ $(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN) FORCE
+ $(call if_changed,objcopy)
++ifdef CONFIG_OX820
++ $(OBJTREE)/tools/mkox820crc $@
++endef
+
+ LDFLAGS_$(SPL_BIN) += -T u-boot-spl.lds $(LDFLAGS_FINAL)
+ ifneq ($(CONFIG_SPL_TEXT_BASE),)
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -488,6 +488,9 @@ config TARGET_BALLOON3
+ config TARGET_H2200
+ bool "Support h2200"
+
++config TARGET_OX820
++ bool "Support ox820"
++
+ config TARGET_PALMLD
+ bool "Support palmld"
+
+@@ -650,6 +653,7 @@ source "board/logicpd/imx27lite/Kconfig"
+ source "board/logicpd/imx31_litekit/Kconfig"
+ source "board/mpl/vcma9/Kconfig"
+ source "board/olimex/mx23_olinuxino/Kconfig"
++source "board/ox820/Kconfig"
+ source "board/palmld/Kconfig"
+ source "board/palmtc/Kconfig"
+ source "board/palmtreo680/Kconfig"
diff --git a/package/boot/uboot-oxnas/patches/800-fix-bootm-assertion.patch b/package/boot/uboot-oxnas/patches/800-fix-bootm-assertion.patch
new file mode 100644
index 0000000..957c492
--- /dev/null
+++ b/package/boot/uboot-oxnas/patches/800-fix-bootm-assertion.patch
@@ -0,0 +1,11 @@
+--- a/common/cmd_bootm.c
++++ b/common/cmd_bootm.c
+@@ -77,7 +77,7 @@ static int do_bootm_subcommand(cmd_tbl_t
+ return CMD_RET_USAGE;
+ }
+
+- if (state != BOOTM_STATE_START && images.state >= state) {
++ if (!(state & BOOTM_STATE_START) && images.state >= state) {
+ printf("Trying to execute a command out of order\n");
+ return CMD_RET_USAGE;
+ }