Skip to content

Commit

Permalink
Initial release of 2014.08.29-1
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay committed Jul 19, 2015
0 parents commit 27275b4
Show file tree
Hide file tree
Showing 6 changed files with 247 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
u-boot-33e05ffb159141b640571e91470172d83a2a1273.tar.gz
46 changes: 46 additions & 0 deletions boot.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#------------------------------------------------------------------------------------------------------
#
# Boot.ini text file template
#
#------------------------------------------------------------------------------------------------------
#
# boot.ini identification
#
#------------------------------------------------------------------------------------------------------
ODROID4412-UBOOT-CONFIG

# U-Boot Parameters
setenv initrd_high "0xffffffff"
setenv fdt_high "0xffffffff"

#------------------------------------------------------------------------------------------------------
#
# Boot Specific Stuff
#
#------------------------------------------------------------------------------------------------------
setenv bootrootfs "root=/dev/mmcblk0p2 ro rootdelay quiet"

#------------------------------------------------------------------------------------------------------
#
# HDMI config
#
#------------------------------------------------------------------------------------------------------
setenv hdtv_type "hdmi"
setenv hdtv_format "720p60hz"

#------------------------------------------------------------------------------------------------------
#
# U-Boot bootcmd command
#
#------------------------------------------------------------------------------------------------------
setenv bootcmd "ext4load mmc 0:2 0x40008000 boot/uImage; ext4load mmc 0:2 0x42000000 boot/uInitrd; bootm 0x40008000 0x42000000"

#------------------------------------------------------------------------------------------------------
#
# Kernel boot arguments
#
#------------------------------------------------------------------------------------------------------
setenv bootargs "${bootrootfs} hdtv_type=${hdtv_type} hdtv_format=${hdtv_format}"

# Boot the board
boot
1 change: 1 addition & 0 deletions grubby
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UBOOT_IMGADDR=0x40008000 # Added by odroid-u3-uboot
133 changes: 133 additions & 0 deletions od-uboot-gcc47.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
diff -urN u-boot-a/arch/arm/cpu/armv7/config.mk u-boot/arch/arm/cpu/armv7/config.mk
--- u-boot-a/arch/arm/cpu/armv7/config.mk 2013-06-11 07:03:04.000000000 -0500
+++ u-boot/arch/arm/cpu/armv7/config.mk 2013-06-11 07:58:38.383184393 -0500
@@ -20,7 +20,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -mfloat-abi=hard -mfpu=vfpv3

# Make ARMv5 to allow more compilers to work, even though its v7a.
PLATFORM_CPPFLAGS += -march=armv7-a
diff -urN u-boot-a/mkbl2.c u-boot/mkbl2.c
--- u-boot-a/mkbl2.c 1969-12-31 18:00:00.000000000 -0600
+++ u-boot/mkbl2.c 2013-06-11 07:51:46.403184194 -0500
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+int main (int argc, char *argv[])
+{
+ FILE *fp;
+ unsigned char src;
+ char *Buf, *a;
+ int BufLen;
+ int nbytes, fileLen;
+ unsigned int checksum = 0;
+ int i;
+
+ if (argc != 4)
+ {
+ printf("Usage: mkbl1 <source file> <destination file> <size> \n");
+ return -1;
+ }
+
+ BufLen = atoi(argv[3]);
+ Buf = (char *)malloc(BufLen);
+ memset(Buf, 0x00, BufLen);
+
+ fp = fopen(argv[1], "rb");
+ if( fp == NULL)
+ {
+ printf("source file open error\n");
+ free(Buf);
+ return -1;
+ }
+
+ fseek(fp, 0L, SEEK_END);
+ fileLen = ftell(fp);
+ fseek(fp, 0L, SEEK_SET);
+
+ if ( BufLen > fileLen )
+ {
+ printf("Usage: unsupported size\n");
+ free(Buf);
+ fclose(fp);
+ return -1;
+ }
+
+ nbytes = fread(Buf, 1, BufLen, fp);
+
+ if ( nbytes != BufLen )
+ {
+ printf("source file read error\n");
+ free(Buf);
+ fclose(fp);
+ return -1;
+ }
+
+ fclose(fp);
+
+ for(i = 0;i < (14 * 1024) - 4;i++)
+ {
+ checksum += (unsigned char)(Buf[i]);
+ }
+ *(unsigned int*)(Buf+i) = checksum;
+
+ fp = fopen(argv[2], "wb");
+ if (fp == NULL)
+ {
+ printf("destination file open error\n");
+ free(Buf);
+ return -1;
+ }
+
+ a = Buf;
+ nbytes = fwrite( a, 1, BufLen, fp);
+
+ if ( nbytes != BufLen )
+ {
+ printf("destination file write error\n");
+ free(Buf);
+ fclose(fp);
+ return -1;
+ }
+
+ free(Buf);
+ fclose(fp);
+
+ return 0;
+}
diff -urN a/Makefile b/Makefile
--- u-boot-a/Makefile 2014-08-29 14:13:57.000000000 -0600
+++ u-boot/Makefile 2015-07-19 14:49:03.745771983 -0600
@@ -345,7 +345,7 @@
$(obj)u-boot.srec: $(obj)u-boot
$(OBJCOPY) -O srec $< $@

-$(obj)u-boot.bin: $(obj)u-boot
+$(obj)u-boot.bin: $(obj)u-boot | mkbl2
$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
$(BOARD_SIZE_CHECK)
ifeq ($(CONFIG_S5PC210),y)
@@ -514,6 +514,9 @@
$(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
-o $@ $(src)lib/asm-offsets.c -c -S

+mkbl2: mkbl2.c
+ $(HOSTCC) $(HOSTCFLAGS) -o $@ $^
+
#########################################################################
else # !config.mk
all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
65 changes: 65 additions & 0 deletions odroid-u-uboot.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
%global commit 33e05ffb159141b640571e91470172d83a2a1273

Name: odroid-u-uboot
Version: 2014.08.29
Release: 1%{?dist}
Summary: U-boot for ODROID-U2/U3/X2

Group: System Environment/Base
License: GPLv2
URL: http://odroid.com/dokuwiki/doku.php?id=en:odroid-u3
Source0: https://github.com/hardkernel/u-boot/archive/%{commit}/u-boot-%{commit}.tar.gz
Source1: boot.ini
Source2: grubby
Patch0: od-uboot-gcc47.patch

# We always need to use a cross compiler because we can't use hardfloat static
# libraries. This means that we'll always produce an ARM package, even when
# built on x86 machines. The code compiled here is also indifferent of the
# architecture used on the ODROID's OS.
BuildArch: noarch

BuildRequires: arm-none-eabi-gcc-cs
BuildRequires: dos2unix
Requires: grubby

%description
U-boot for Hardkernel's ODROID-U2/U3/X2. This package installs u-boot.bin and a
default boot.ini, and also configures grubby.

%prep
%setup -qn u-boot-%{commit}
%patch0 -p1
rm -f mkbl2
#dos2unix COPYING.txt
#chmod 644 COPYING.txt

%build
make %{?_smp_mflags} smdk4412_config
make %{?_smp_mflags} CROSS_COMPILE=arm-none-eabi-

%install
install -p -m0644 -D %{SOURCE2} %{buildroot}%{_datadir}/%{name}/grubby-%{version}-%{release}
install -p -m0644 -D %{SOURCE1} %{buildroot}/boot/uboot/boot.ini
install -p -m0755 -D u-boot.bin %{buildroot}/boot/uboot/u-boot.bin

ln -s grubby-%{version}-%{release} %{buildroot}%{_datadir}/%{name}/grubby

%post
cat %{_datadir}/%{name}/grubby-%{version}-%{release} >> %{_sysconfdir}/sysconfig/uboot

%preun
while read l; do
sed -i "0,/^`echo "$l" | sed 's/\//\\\\\//g'`/{//d}" %{_sysconfdir}/sysconfig/uboot
done < %{_datadir}/%{name}/grubby-%{version}-%{release}

%files
%doc COPYING COPYING.txt CREDITS MAINTAINERS README
%{_datadir}/%{name}/grubby
%{_datadir}/%{name}/grubby-%{version}-%{release}
%config(noreplace) /boot/uboot/boot.ini
/boot/uboot/u-boot.bin

%changelog
* Sun Jul 19 2015 Scott K Logan <[email protected]> - 2014.08.29-1
- Initial package
1 change: 1 addition & 0 deletions sources
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b0f61b6e284c119cd98e7c999376e684 u-boot-33e05ffb159141b640571e91470172d83a2a1273.tar.gz

0 comments on commit 27275b4

Please sign in to comment.