Permalink
Browse files

Applying HTC 2.04 Upstream patch

  • Loading branch information...
1 parent 06eee2d commit 3df320f7ea4bb46bfa65e63514741bc2f95ba2f2 @zarboz zarboz committed Apr 10, 2013
Showing 3,732 changed files with 80,909 additions and 285,263 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
View
@@ -1,43 +1,54 @@
---Please follow below command to download the official android toolchain: (arm-eabi-4.6)
-
- git clone https://android.googlesource.com/platform/prebuilt
-
- NOTE: the tool ��git�� will need to be installed first; for example, on Ubuntu, the installation command would be: apt-get install git
-
---Modify the .bashrc to add the toolchain path, like bellowing example:
-
- PATH=/usr/local/share/toolchain-eabi-4.6/bin:$PATH
-
---Start
-$make ARCH=arm CROSS_COMPILE=$TOP/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi- apq8064_defconfig
-$make ARCH=arm CROSS_COMPILE=$TOP/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi- -j8
-
-$TOP is an absolute path to android JB code base
-
-
---Clean
- $make clean
-
---Files path
-After build process is finished, there should a zImage under arch/arm/boot/
-l. fastboot flash zimage arch/arm/boot/zImage
-2. Update all kernel modules as follow
- adb remount
- adb push ./drivers/input/evbug.ko system/lib/modules/
- adb push ./drivers/crypto/msm/qcedev.ko system/lib/modules/
- adb push ./drivers/crypto/msm/qcrypto.ko system/lib/modules/
- adb push ./drivers/crypto/msm/qce40.ko system/lib/modules/
- adb push ./drivers/misc/eeprom/eeprom_93cx6.ko system/lib/modules/
- adb push ./drivers/spi/spidev.ko system/lib/modules/
- adb push ./drivers/scsi/scsi_wait_scan.ko system/lib/modules/
- adb push ./drivers/video/backlight/lcd.ko system/lib/modules/
- adb push ./drivers/bluetooth/bluetooth-power.ko system/lib/modules/
- adb push ./drivers/net/ethernet/micrel/ks8851.ko system/lib/modules/
- adb push ./drivers/net/wireless/bcmdhd_4334/bcmdhd.ko system/lib/modules/
- adb push ./drivers/media/video/gspca/gspca_main.ko system/lib/modules/
- adb push ./crypto/ansi_cprng.ko system/lib/modules/
- adb push ./arch/arm/mach-msm/msm-buspm-dev.ko system/lib/modules/
- adb push ./arch/arm/mach-msm/reset_modem.ko system/lib/modules/
- adb push ./block/test-iosched.ko system/lib/modules/
- adb shell chmod 0644 system/lib/modules/*
- adb reboot
+defconfig file: apq8064_defconfig (arm-eabi-4.6)
+
+Download:
+=========
+If you are not already using an AOSP toolchain (included in an AOSP build tree), download the corresponding official android toolchain for the arm-eabi specified above for this device:
+
+git clone https://android.googlesource.com/platform/prebuilt for 4.4.3
+git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6 for 4.6
+(use darwin-x86 in place of linux-x86 for mac)
+
+Build the kernel:
+=================
+set the following environment variables:
+
+export TOP= [where you installed the toolchain or top of android AOSP code base]
+export PATH=$TOP/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin:$PATH (use corresponding arm-eabi bin path)
+export ARCH=arm
+export SUBARCH=arm
+export CROSS_COMPILE=arm-eabi-
+
+make [the defconfig file for this device above]
+make clean (for subsequent builds)
+make -j4 (in this example 4 is the number of processors of your build machine)
+
+Output Binary Files:
+====================
+After the build process is finished, there should be a file named "zImage" found in arch/arm/boot/
+If you are building a rom with this kernel ZImage, copy it into your build's output folder and rename it to "kernel".
+
+You will also need the following kernel modules. These will eventually be installed into /system/lib/modules on the device.
+
+kernel modules:
+./drivers/input/evbug.ko
+./drivers/crypto/msm/qcedev.ko
+./drivers/crypto/msm/qcrypto.ko
+./drivers/crypto/msm/qce40.ko
+./drivers/misc/eeprom/eeprom_93cx6.ko
+./drivers/spi/spidev.ko
+./drivers/scsi/scsi_wait_scan.ko
+./drivers/video/backlight/lcd.ko
+./drivers/bluetooth/bluetooth-power.ko
+./drivers/net/ethernet/micrel/ks8851.ko
+./drivers/net/wireless/bcmdhd_4334/bcmdhd.ko
+./drivers/media/video/gspca/gspca_main.ko
+./crypto/ansi_cprng.ko
+./arch/arm/mach-msm/msm-buspm-dev.ko
+./arch/arm/mach-msm/reset_modem.ko
+./block/test-iosched.ko
+
+If you have already built and installed a boot.img with root access you can also install the modules directly into the device using "adb remount" and "apb push [file] system/lib/modules/" for each file listed above. After installing files set permissions with "adb shell chmod 0644 system/lib/modules/*" and "adb reboot"
+
+For additional information:
+===========================
+http://htcdev.com
@@ -36,36 +36,28 @@ static int setprop_cell(void *fdt, const char *node_path,
return fdt_setprop_cell(fdt, offset, property, val);
}
-/*
- * Convert and fold provided ATAGs into the provided FDT.
- *
- * REturn values:
- * = 0 -> pretend success
- * = 1 -> bad ATAG (may retry with another possible ATAG pointer)
- * < 0 -> error from libfdt
- */
int atags_to_fdt(void *atag_list, void *fdt, int total_space)
{
struct tag *atag = atag_list;
uint32_t mem_reg_property[2 * NR_BANKS];
int memcount = 0;
int ret;
- /* make sure we've got an aligned pointer */
+
if ((u32)atag_list & 0x3)
return 1;
- /* if we get a DTB here we're done already */
+
if (*(u32 *)atag_list == fdt32_to_cpu(FDT_MAGIC))
return 0;
- /* validate the ATAG */
+
if (atag->hdr.tag != ATAG_CORE ||
(atag->hdr.size != tag_size(tag_core) &&
atag->hdr.size != 2))
return 1;
- /* let's give it all the room it could need */
+
ret = fdt_open_into(fdt, fdt, total_space);
if (ret < 0)
return ret;
@@ -1,8 +1,8 @@
#define _LINUX_STRING_H_
-#include <linux/compiler.h> /* for inline */
-#include <linux/types.h> /* for size_t */
-#include <linux/stddef.h> /* for NULL */
+#include <linux/compiler.h>
+#include <linux/types.h>
+#include <linux/stddef.h>
#include <linux/linkage.h>
#include <asm/string.h>
@@ -11,11 +11,10 @@ extern unsigned long free_mem_end_ptr;
extern void error(char *);
#define STATIC static
-#define STATIC_RW_DATA /* non-static please */
+#define STATIC_RW_DATA
#define ARCH_HAS_DECOMP_WDOG
-/* Diagnostic functions */
#ifdef DEBUG
# define Assert(cond,msg) {if(!(cond)) error(msg);}
# define Trace(x) fprintf x
@@ -1,26 +1,9 @@
-/*
- * misc.c
- *
- * This is a collection of several routines from gzip-1.0.3
- * adapted for Linux.
- *
- * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
- *
- * Modified for ARM Linux by Russell King
- *
- * Nicolas Pitre <nico@visuaide.com> 1999/04/14 :
- * For this code to run directly from Flash, all constant variables must
- * be marked with 'const' and all other variables initialized at run-time
- * only. This way all non constant variables will end up in the bss segment,
- * which should point to addresses in RAM and cleared to 0 on start.
- * This allows for a much quicker boot time.
- */
unsigned int __machine_arch_type;
#define _LINUX_STRING_H_
-#include <linux/compiler.h> /* for inline */
+#include <linux/compiler.h>
#include <linux/types.h> /* for size_t */
#include <linux/stddef.h> /* for NULL */
#include <linux/linkage.h>
@@ -136,9 +119,6 @@ void *memcpy(void *__dest, __const void *__src, size_t __n)
return __dest;
}
-/*
- * gzip declarations
- */
extern char input_data[];
extern char input_data_end[];
@@ -159,7 +139,7 @@ void error(char *x)
putstr(x);
putstr("\n\n -- System halted");
- while(1); /* Halt */
+ while(1);
}
asmlinkage void __div0(void)
@@ -0,0 +1,65 @@
+--- arch/arm/boot/compressed/mmcif-sh7372.c 2013-01-04 04:01:38.000000000 -0800
++++ arch/arm/boot/compressed/mmcif-sh7372.c 2013-03-19 04:01:03.000000000 -0700
+@@ -28,28 +28,11 @@
+
+ #define SMSTPCR3 (void __iomem *)0xe615013c
+
+-/* SH7372 specific MMCIF loader
+- *
+- * loads the zImage from an MMC card starting from block 1.
+- *
+- * The image must be start with a vrl4 header and
+- * the zImage must start at offset 512 of the image. That is,
+- * at block 2 (=byte 1024) on the media
+- *
+- * Use the following line to write the vrl4 formated zImage
+- * to an MMC card
+- * # dd if=vrl4.out of=/dev/sdx bs=512 seek=1
+- */
+ asmlinkage void mmc_loader(unsigned char *buf, unsigned long len)
+ {
+ mmc_init_progress();
+ mmc_update_progress(MMC_PROGRESS_ENTER);
+
+- /* Initialise MMC
+- * registers: PORT84CR-PORT92CR
+- * (MMCD0_0-MMCD0_7,MMCCMD0 Control)
+- * value: 0x04 - select function 4
+- */
+ __raw_writeb(0x04, PORT84CR);
+ __raw_writeb(0x04, PORT85CR);
+ __raw_writeb(0x04, PORT86CR);
+@@ -60,28 +43,24 @@
+ __raw_writeb(0x04, PORT91CR);
+ __raw_writeb(0x04, PORT92CR);
+
+- /* Initialise MMC
+- * registers: PORT99CR (MMCCLK0 Control)
+- * value: 0x10 | 0x04 - enable output | select function 4
+- */
+ __raw_writeb(0x14, PORT99CR);
+
+- /* Enable clock to MMC hardware block */
++
+ __raw_writel(__raw_readl(SMSTPCR3) & ~(1 << 12), SMSTPCR3);
+
+ mmc_update_progress(MMC_PROGRESS_INIT);
+
+- /* setup MMCIF hardware */
++
+ sh_mmcif_boot_init(MMCIF_BASE);
+
+ mmc_update_progress(MMC_PROGRESS_LOAD);
+
+- /* load kernel via MMCIF interface */
+- sh_mmcif_boot_do_read(MMCIF_BASE, 2, /* Kernel is at block 2 */
++
++ sh_mmcif_boot_do_read(MMCIF_BASE, 2,
+ (len + SH_MMCIF_BBS - 1) / SH_MMCIF_BBS, buf);
+
+
+- /* Disable clock to MMC hardware block */
++
+ __raw_writel(__raw_readl(SMSTPCR3) | (1 << 12), SMSTPCR3);
+
+ mmc_update_progress(MMC_PROGRESS_DONE);
@@ -1,13 +1,3 @@
-/*
- * linux/arch/arm/boot/compressed/ofw-shark.c
- *
- * by Alexander Schulz
- *
- * This file is used to get some basic information
- * about the memory layout of the shark we are running
- * on. Memory is usually divided in blocks a 8 MB.
- * And bootargs are copied from OpenFirmware.
- */
#include <linux/kernel.h>
@@ -19,27 +9,27 @@
asmlinkage void
create_params (unsigned long *buffer)
{
- /* Is there a better address? Also change in mach-shark/core.c */
+
struct tag *tag = (struct tag *) 0x08003000;
int j,i,m,k,nr_banks,size;
unsigned char *c;
k = 0;
- /* Head of the taglist */
+
tag->hdr.tag = ATAG_CORE;
tag->hdr.size = tag_size(tag_core);
tag->u.core.flags = 1;
tag->u.core.pagesize = PAGE_SIZE;
tag->u.core.rootdev = 0;
- /* Build up one tagged block for each memory region */
+
size=0;
nr_banks=(unsigned int) buffer[0];
for (j=0;j<nr_banks;j++){
- /* search the lowest address and put it into the next entry */
- /* not a fast sort algorithm, but there are at most 8 entries */
- /* and this is used only once anyway */
+
+
+
m=0xffffffff;
for (i=0;i<(unsigned int) buffer[0];i++){
if (buffer[2*i+1]<m) {
@@ -56,10 +46,10 @@ create_params (unsigned long *buffer)
size += buffer[2*k+2];
- buffer[2*k+1]=0xffffffff; /* mark as copied */
+ buffer[2*k+1]=0xffffffff;
}
- /* The command line */
+
tag = tag_next(tag);
tag->hdr.tag = ATAG_CMDLINE;
@@ -70,13 +60,13 @@ create_params (unsigned long *buffer)
tag->u.cmdline.cmdline[j]=0;
tag->hdr.size = (j + 7 + sizeof(struct tag_header)) >> 2;
- /* Hardware revision */
+
tag = tag_next(tag);
tag->hdr.tag = ATAG_REVISION;
tag->hdr.size = tag_size(tag_revision);
tag->u.revision.rev = ((unsigned char) buffer[33])-'0';
- /* End of the taglist */
+
tag = tag_next(tag);
tag->hdr.tag = 0;
tag->hdr.size = 0;
@@ -85,11 +75,6 @@ create_params (unsigned long *buffer)
typedef int (*ofw_handle_t)(void *);
-/* Everything below is called with a wrong MMU setting.
- * This means: no string constants, no initialization of
- * arrays, no global variables! This is ugly but I didn't
- * want to write this in assembler :-)
- */
int
of_decode_int(const unsigned char *p)
Oops, something went wrong.

0 comments on commit 3df320f

Please sign in to comment.