From 077d48b9313aced4aabf7125fc9a54f4bf9f37ab Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Thu, 01 Aug 2019 18:16:15 +0800
Subject: [PATCH] update linux kernel, u-boot patch. adjust partition table, update rootfs build shell script to new partition. test ok

---
 ok335xD/linux-bsp/patches/linux-3.2.0-ok335x.patch |  165 ++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 140 insertions(+), 25 deletions(-)

diff --git a/ok335xD/linux-bsp/patches/linux-3.2.0-ok335x.patch b/ok335xD/linux-bsp/patches/linux-3.2.0-ok335x.patch
index 7938ec2..2e442b6 100644
--- a/ok335xD/linux-bsp/patches/linux-3.2.0-ok335x.patch
+++ b/ok335xD/linux-bsp/patches/linux-3.2.0-ok335x.patch
@@ -1,6 +1,121 @@
+diff -Nuar linux-3.2.0/arch/arm/mach-omap2/board-am335xevm.c linux-3.2.0-ok335x/arch/arm/mach-omap2/board-am335xevm.c
+--- linux-3.2.0/arch/arm/mach-omap2/board-am335xevm.c	2014-01-22 18:20:21.000000000 +0800
++++ linux-3.2.0-ok335x/arch/arm/mach-omap2/board-am335xevm.c	2019-08-01 12:55:20.735041318 +0800
+@@ -2017,47 +2017,38 @@
+ 	am33xx_register_ehrpwm(2, &pwm_pdata[2]);
+ }
+ 
+-/* NAND partition information */
++
++/* NAND(MT29F2G08ABAEAWP, 256M) partition information, modify partition by guowenxue */
+ static struct mtd_partition am335x_nand_partitions[] = {
+ /* All the partition sizes are listed in terms of NAND block size */
+ 	{
+ 		.name           = "SPL",
+-		.offset         = 0,			/* Offset = 0x0 */
+-		.size           = SZ_128K,
+-	},
+-	{
+-		.name           = "SPL.backup1",
+-		.offset         = MTDPART_OFS_APPEND,	/* Offset = 0x20000 */
+-		.size           = SZ_128K,
+-	},
+-	{
+-		.name           = "SPL.backup2",
+-		.offset         = MTDPART_OFS_APPEND,	/* Offset = 0x40000 */
+-		.size           = SZ_128K,
+-	},
+-	{
+-		.name           = "SPL.backup3",
+-		.offset         = MTDPART_OFS_APPEND,	/* Offset = 0x60000 */
+-		.size           = SZ_128K,
++		.offset         = 0,			        /* Offset = 0x000000 */
++		.size           = 1*SZ_512K,
+ 	},
+ 	{
+ 		.name           = "U-Boot",
+-		.offset         = MTDPART_OFS_APPEND,   /* Offset = 0x80000 */
+-		.size           = 15 * SZ_128K,
++		.offset         = MTDPART_OFS_APPEND,   /* Offset = 0x080000 */
++		.size           = 1*SZ_256K,
+ 	},
+ 	{
+ 		.name           = "U-Boot Env",
+-		.offset         = MTDPART_OFS_APPEND,   /* Offset = 0x260000 */
+-		.size           = 1 * SZ_128K,
++		.offset         = MTDPART_OFS_APPEND,   /* Offset = 0x0C0000 */
++		.size           = 1*SZ_256K,
+ 	},
+ 	{
+ 		.name           = "Kernel",
+-		.offset         = MTDPART_OFS_APPEND,   /* Offset = 0x280000 */
+-		.size           = 40 * SZ_128K,
++		.offset         = MTDPART_OFS_APPEND,   /* Offset = 0x100000 */
++		.size           = 5*SZ_1M,
+ 	},
+ 	{
+-		.name           = "File System",
+-		.offset         = MTDPART_OFS_APPEND,   /* Offset = 0x780000 */
++		.name           = "Rootfs",
++		.offset         = MTDPART_OFS_APPEND,   /* Offset = 0x600000 */
++		.size           = 150*SZ_1M, 
++	},
++	{
++		.name           = "Apps",
++		.offset         = MTDPART_OFS_APPEND,   /* Offset = 0x9c00000 */
+ 		.size           = MTDPART_SIZ_FULL,
+ 	},
+ };
+@@ -2160,8 +2151,10 @@
+ 		&am335x_nand_timings);
+ 	if (!pdata)
+ 		return;
+-//	pdata->ecc_opt =OMAP_ECC_BCH8_CODE_HW;
+-        pdata->ecc_opt =OMAP_ECC_HAMMING_CODE_DEFAULT;
++
++    /* Modify by guowenxue, kernel & rootfs must use ECC_BCH8 in u-boot */
++	pdata->ecc_opt =OMAP_ECC_BCH8_CODE_HW; 
++    //pdata->ecc_opt =OMAP_ECC_HAMMING_CODE_DEFAULT;
+ 
+ 	pdata->elm_used = true;
+ 	gpmc_device[0].pdata = pdata;
+@@ -3121,10 +3114,15 @@
+ 
+ static int __init screentype_setup(char *str)
+ {
++    /* Modify by guowenxue, our OK335XD use 800x480-7" capacitive LCD */
++    screen_type = SCREEN_TYPE_C;
++
++#if 0
+ 	if(!strncmp(str,"C",1))
+ 		screen_type = SCREEN_TYPE_C;
+ 	else 
+ 		screen_type = SCREEN_TYPE_R;
++#endif
+ 	
+ 	return 1;
+ }
+@@ -3132,6 +3130,9 @@
+ 
+ static int __init screensize_setup(char *str)
+ {
++    /* Modify by guowenxue, our OK335XD use 800x480-7" capacitive LCD */
++    screen_size = SCREEN_SIZE_800X480_7; 
++#if 0
+ 	if(!strncmp(str,"800x600-8",9))
+ 		screen_size = SCREEN_SIZE_800X600_8;
+ 	else if(!strncmp(str,"800x480-5",9))
+@@ -3142,6 +3143,7 @@
+ 		screen_size = SCREEN_SIZE_800X600_10;
+ 	else
+ 		screen_size = SCREEN_SIZE_480X272_4;
++#endif
+ 	
+ 	return 1;
+ }
 diff -Nuar linux-3.2.0/build.sh linux-3.2.0-ok335x/build.sh
 --- linux-3.2.0/build.sh	1970-01-01 08:00:00.000000000 +0800
-+++ linux-3.2.0-ok335x/build.sh	2019-07-28 19:50:53.620890149 +0800
++++ linux-3.2.0-ok335x/build.sh	2019-08-01 12:52:36.239038163 +0800
 @@ -0,0 +1,74 @@
 +#!/bin/bash
 +
@@ -8,7 +123,7 @@
 +IMGS_PATH=../images
 +IMG_NAME=uImage
 +
-+INITRAMFS=YES
++#INITRAMFS=YES
 +
 +CROSSTOOL=/opt/crosstool/cortex-a7/bin/arm-linux-gnueabi-
 +JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l`
@@ -78,8 +193,8 @@
 +
 diff -Nuar linux-3.2.0/.cfg-ok335x linux-3.2.0-ok335x/.cfg-ok335x
 --- linux-3.2.0/.cfg-ok335x	1970-01-01 08:00:00.000000000 +0800
-+++ linux-3.2.0-ok335x/.cfg-ok335x	2019-07-28 19:30:47.652867015 +0800
-@@ -0,0 +1,2955 @@
++++ linux-3.2.0-ok335x/.cfg-ok335x	2019-08-01 12:55:57.327042020 +0800
+@@ -0,0 +1,2936 @@
 +#
 +# Automatically generated file; DO NOT EDIT.
 +# Linux/arm 3.2.0 Kernel Configuration
@@ -169,21 +284,7 @@
 +# CONFIG_SCHED_AUTOGROUP is not set
 +# CONFIG_SYSFS_DEPRECATED is not set
 +# CONFIG_RELAY is not set
-+CONFIG_BLK_DEV_INITRD=y
-+CONFIG_INITRAMFS_SOURCE="../rootfs"
-+CONFIG_INITRAMFS_ROOT_UID=0
-+CONFIG_INITRAMFS_ROOT_GID=0
-+CONFIG_RD_GZIP=y
-+CONFIG_RD_BZIP2=y
-+CONFIG_RD_LZMA=y
-+CONFIG_RD_XZ=y
-+CONFIG_RD_LZO=y
-+CONFIG_INITRAMFS_COMPRESSION_NONE=y
-+# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set
-+# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set
-+# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set
-+# CONFIG_INITRAMFS_COMPRESSION_XZ is not set
-+# CONFIG_INITRAMFS_COMPRESSION_LZO is not set
++# CONFIG_BLK_DEV_INITRD is not set
 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 +CONFIG_SYSCTL=y
 +CONFIG_ANON_INODES=y
@@ -3023,11 +3124,6 @@
 +CONFIG_XZ_DEC_SPARC=y
 +CONFIG_XZ_DEC_BCJ=y
 +# CONFIG_XZ_DEC_TEST is not set
-+CONFIG_DECOMPRESS_GZIP=y
-+CONFIG_DECOMPRESS_BZIP2=y
-+CONFIG_DECOMPRESS_LZMA=y
-+CONFIG_DECOMPRESS_XZ=y
-+CONFIG_DECOMPRESS_LZO=y
 +CONFIG_GENERIC_ALLOCATOR=y
 +CONFIG_HAS_IOMEM=y
 +CONFIG_HAS_IOPORT=y
@@ -3035,9 +3131,28 @@
 +CONFIG_NLATTR=y
 +CONFIG_AVERAGE=y
 +# CONFIG_CORDIC is not set
+diff -Nuar linux-3.2.0/ChangeLog.txt linux-3.2.0-ok335x/ChangeLog.txt
+--- linux-3.2.0/ChangeLog.txt	1970-01-01 08:00:00.000000000 +0800
++++ linux-3.2.0-ok335x/ChangeLog.txt	2019-08-01 12:52:36.243038163 +0800
+@@ -0,0 +1,15 @@
++
++1. Nandflash(MT29F2G08ABAEAWP, 256M) Partition 
++-----------------------------------------------
++
++arch/arm/mach-omap2/board-am335xevm.c:
++
++0x000000000000-0x000000080000 : "SPL"
++0x000000080000-0x0000000c0000 : "U-Boot"
++0x0000000c0000-0x000000100000 : "U-Boot Env"
++0x000000100000-0x000000600000 : "Kernel"
++0x000000600000-0x000009c00000 : "Rootfs"
++0x000009c00000-0x000010000000 : "Apps"
++
++
++
 diff -Nuar linux-3.2.0/Makefile linux-3.2.0-ok335x/Makefile
 --- linux-3.2.0/Makefile	2019-07-28 20:25:29.000000000 +0800
-+++ linux-3.2.0-ok335x/Makefile	2019-07-28 19:48:39.992887585 +0800
++++ linux-3.2.0-ok335x/Makefile	2019-08-01 12:52:36.259038163 +0800
 @@ -192,8 +192,8 @@
  # Default value for CROSS_COMPILE is not to prefix executables
  # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile

--
Gitblit v1.9.1