--- x-loader-1.4.4git20100713.orig/debian/rules +++ x-loader-1.4.4git20100713/debian/rules @@ -0,0 +1,27 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 +unexport LDFLAGS + +%: + dh --with quilt $@ + +override_dh_auto_configure: + $(MAKE) omap3530beagle_config + +override_dh_auto_install: + $(CC) -o signGP signGP.c + ./signGP x-load.bin + install -D -m644 x-load.bin.ift debian/tmp/usr/lib/x-loader-omap/MLO + install -D -m644 x-load.bin debian/tmp/usr/lib/x-loader-omap/x-load.bin + +override_dh_auto_clean: + rm -f signGP x-load.bin.ift + $(MAKE) distclean --- x-loader-1.4.4git20100713.orig/debian/x-loader-omap.install +++ x-loader-1.4.4git20100713/debian/x-loader-omap.install @@ -0,0 +1 @@ +usr/lib/x-loader-omap/ --- x-loader-1.4.4git20100713.orig/debian/docs +++ x-loader-1.4.4git20100713/debian/docs @@ -0,0 +1 @@ +README --- x-loader-1.4.4git20100713.orig/debian/copyright +++ x-loader-1.4.4git20100713/debian/copyright @@ -0,0 +1,80 @@ +This work was packaged for Debian by: + + Oliver Grawert on Sat, 20 Mar 2010 09:51:26 +0000 + +It was downloaded from: + + http://gitorious.org/x-load-omap3/mainline/commits/master + +Upstream Authors: + + Wolfgang Denk, DENX Software Engineering, wd@denx.de. + Jian Zhang + Steve Sakoman + +Copyright: + + Copyright (C) 2004-2006, Texas Instruments, + Jian Zhang + Copyright (C) 2000-2004 + Wolfgang Denk, DENX Software Engineering, wd@denx.de. + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General +Public License version 2 can be found in `/usr/share/common-licenses/GPL-2'. + +The Debian packaging is: + + Copyright (C) 2010 Oliver Grawert + +you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +The file include/malloc.h is distributed under the +http://creativecommons.org/licenses/publicdomain/ license: + + Copyright (C) Doug Lea + +The person or persons who have associated work with this document +(the "Dedicator" or "Certifier") hereby either (a) certifies that, to +the best of his knowledge, the work of authorship identified is in the +public domain of the country from which the work is published, or (b) +hereby dedicates whatever copyright the dedicators holds in the work of +authorship identified below (the "Work") to the public domain. A certifier, +moreover, dedicates any copyright interest he may have in the associated +work, and for these purposes, is described as a "dedicator" below. + +A certifier has taken reasonable steps to verify the copyright status of +this work. Certifier recognizes that his good faith efforts may not shield +him from liability if in fact the work certified is not in the public domain. + +Dedicator makes this dedication for the benefit of the public at large and +to the detriment of the Dedicator's heirs and successors. Dedicator intends +this dedication to be an overt act of relinquishment in perpetuity of all +present and future rights under copyright law, whether vested or contingent, +in the Work. Dedicator understands that such relinquishment of all rights +includes the relinquishment of all rights to enforce +(by lawsuit or otherwise) those copyrights in the Work. + +Dedicator recognizes that, once placed in the public domain, the Work may be +freely reproduced, distributed, transmitted, used, modified, built upon, or +otherwise exploited by anyone for any purpose, commercial or non-commercial, +and in any way, including by methods that have not yet been invented +or conceived. --- x-loader-1.4.4git20100713.orig/debian/README.source +++ x-loader-1.4.4git20100713/debian/README.source @@ -0,0 +1,17 @@ +x-loader for Debian +------------------- + + + +This package uses quilt to manage all modifications to the upstream +source. Changes are stored in the source package as diffs in +debian/patches and applied during the build. Please see: + + /usr/share/doc/quilt/README.source + +for more information on how to apply the patches, modify patches, or +remove a patch. + + + --- x-loader-1.4.4git20100713.orig/debian/control +++ x-loader-1.4.4git20100713/debian/control @@ -0,0 +1,14 @@ +Source: x-loader +Section: misc +Priority: extra +Maintainer: Oliver Grawert +Build-Depends: quilt (>= 0.46-7~), debhelper (>= 7) +Standards-Version: 3.8.4 + +Package: x-loader-omap +Architecture: armel +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Board initialization helper for TI OMAP CPUs + TI x-loader initializes OMAP based boards to get the hardware + to a stage where it is possible to load and initialize a + bootloader (i.e. the commonly used u-boot) --- x-loader-1.4.4git20100713.orig/debian/changelog +++ x-loader-1.4.4git20100713/debian/changelog @@ -0,0 +1,34 @@ +x-loader (1.4.4git20100713-1ubuntu3) natty; urgency=low + + * Replace contents of support_micron_and_numonyx_memory with + ee120c894c3377054bda149748eb0621f2f843c8 from Steve Sakoman's + x-loader.git; this only differs in the else clause when not using Micron + memory in that it sets up the second bank with the correct size; thanks + Steve Sakoman and Peter Maydell; LP: #652861. + + -- Loïc Minier Wed, 27 Oct 2010 17:55:40 -0400 + +x-loader (1.4.4git20100713-1ubuntu2) maverick; urgency=low + + * Drop confusing and useless $(sh) usage in rules. + + -- Loïc Minier Tue, 28 Sep 2010 12:15:55 +0200 + +x-loader (1.4.4git20100713-1ubuntu1) maverick; urgency=low + + * adding support_micron_and_numonyx_memory.patch to make x-loader + work with Micron and Numonyx based Beagle xMs (LP: #628243) + + -- Ricardo Salveti de Araujo Wed, 01 Sep 2010 14:30:46 -0300 + +x-loader (1.4.4git20100713-1) maverick; urgency=low + + * new upstream release + + -- Oliver Grawert Tue, 13 Jul 2010 13:11:12 +0100 + +x-loader (1.4.3git20100305-1) lucid; urgency=low + + * Initial release + + -- Oliver Grawert Sat, 20 Mar 2010 09:51:26 +0000 --- x-loader-1.4.4git20100713.orig/debian/compat +++ x-loader-1.4.4git20100713/debian/compat @@ -0,0 +1 @@ +7 --- x-loader-1.4.4git20100713.orig/debian/patches/no_cross_compile.diff +++ x-loader-1.4.4git20100713/debian/patches/no_cross_compile.diff @@ -0,0 +1,13 @@ +Index: x-loader-1.4.3git20100305/Makefile +=================================================================== +--- x-loader-1.4.3git20100305.orig/Makefile 2010-03-20 11:03:18.857943968 +0000 ++++ x-loader-1.4.3git20100305/Makefile 2010-03-20 11:03:37.567938849 +0000 +@@ -53,7 +53,7 @@ + include $(TOPDIR)/config.mk + + ifndef CROSS_COMPILE +-CROSS_COMPILE = arm-none-linux-gnueabi- ++#CROSS_COMPILE = arm-none-linux-gnueabi- + #CROSS_COMPILE = arm-linux- + export CROSS_COMPILE + endif --- x-loader-1.4.4git20100713.orig/debian/patches/add_signGP.diff +++ x-loader-1.4.4git20100713/debian/patches/add_signGP.diff @@ -0,0 +1,78 @@ +Index: x-loader-1.4.3git20100305/signGP.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ x-loader-1.4.3git20100305/signGP.c 2010-03-20 12:25:33.297938213 +0000 +@@ -0,0 +1,73 @@ ++// ++// signGP.c ++// Read the x-load.bin file and write out the x-load.bin.ift file. ++// The signed image is the original pre-pended with the size of the image ++// and the load address. If not entered on command line, file name is ++// assumed to be x-load.bin in current directory and load address is ++// 0x40200800. ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++ ++main(int argc, char *argv[]) ++{ ++ int i; ++ char ifname[FILENAME_MAX], ofname[FILENAME_MAX], ch; ++ FILE *ifile, *ofile; ++ unsigned long loadaddr, len; ++ struct stat sinfo; ++ ++ ++ // Default to x-load.bin and 0x40200800. ++ strcpy(ifname, "x-load.bin"); ++ loadaddr = 0x40200800; ++ ++ if ((argc == 2) || (argc == 3)) ++ strcpy(ifname, argv[1]); ++ ++ if (argc == 3) ++ loadaddr = strtol(argv[2], NULL, 16); ++ ++ // Form the output file name. ++ strcpy(ofname, ifname); ++ strcat(ofname, ".ift"); ++ ++ // Open the input file. ++ ifile = fopen(ifname, "rb"); ++ if (ifile == NULL) { ++ printf("Cannot open %s\n", ifname); ++ exit(0); ++ } ++ ++ // Get file length. ++ stat(ifname, &sinfo); ++ len = sinfo.st_size; ++ ++ // Open the output file and write it. ++ ofile = fopen(ofname, "wb"); ++ if (ofile == NULL) { ++ printf("Cannot open %s\n", ofname); ++ fclose(ifile); ++ exit(0); ++ } ++ ++ // Pad 1 sector of zeroes. ++ //ch = 0x00; ++ //for (i=0; i<0x200; i++) ++ // fwrite(&ch, 1, 1, ofile); ++ ++ fwrite(&len, 1, 4, ofile); ++ fwrite(&loadaddr, 1, 4, ofile); ++ for (i=0; i +Date: Thu, 8 Jul 2010 10:30:58 -0500 +Subject: [PATCH] Support Micron or Numonyx memory + +* Updated Numonyx memory size. +--- + board/omap3530beagle/omap3530beagle.c | 56 +++++++++++++++++++++++++++----- + drivers/k9f1g08r0a.c | 43 +++++++++++++++++++------ + include/asm/arch-omap3/mem.h | 43 ++++++++++++++++++++++++- + 3 files changed, 121 insertions(+), 21 deletions(-) + +diff --git a/board/omap3530beagle/omap3530beagle.c b/board/omap3530beagle/omap3530beagle.c +index eb8008e..1b3d8c7 100644 +--- a/board/omap3530beagle/omap3530beagle.c ++++ b/board/omap3530beagle/omap3530beagle.c +@@ -265,6 +265,32 @@ u32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound) + } + + #ifdef CFG_3430SDRAM_DDR ++ ++#define MICRON_DDR 0 ++#define NUMONYX_MCP 1 ++int identify_xm_ddr() ++{ ++ int mfr, id; ++ ++ __raw_writel(M_NAND_GPMC_CONFIG1, GPMC_CONFIG1 + GPMC_CONFIG_CS0); ++ __raw_writel(M_NAND_GPMC_CONFIG2, GPMC_CONFIG2 + GPMC_CONFIG_CS0); ++ __raw_writel(M_NAND_GPMC_CONFIG3, GPMC_CONFIG3 + GPMC_CONFIG_CS0); ++ __raw_writel(M_NAND_GPMC_CONFIG4, GPMC_CONFIG4 + GPMC_CONFIG_CS0); ++ __raw_writel(M_NAND_GPMC_CONFIG5, GPMC_CONFIG5 + GPMC_CONFIG_CS0); ++ __raw_writel(M_NAND_GPMC_CONFIG6, GPMC_CONFIG6 + GPMC_CONFIG_CS0); ++ ++ /* Enable the GPMC Mapping */ ++ __raw_writel((((OMAP34XX_GPMC_CS0_SIZE & 0xF)<<8) | ++ ((NAND_BASE_ADR>>24) & 0x3F) | ++ (1<<6)), (GPMC_CONFIG7 + GPMC_CONFIG_CS0)); ++ delay(2000); ++ ++ nand_readid(&mfr, &id); ++ if (mfr == 0) ++ return MICRON_DDR; ++ if ((mfr == 0x20) && (id == 0xba)) ++ return NUMONYX_MCP; ++} + /********************************************************************* + * config_3430sdram_ddr() - Init DDR on 3430SDP dev board. + *********************************************************************/ +@@ -279,15 +305,27 @@ void config_3430sdram_ddr(void) + __raw_writel(SDP_SDRC_SHARING, SDRC_SHARING); + + if (beagle_revision() == REVISION_XM) { +- __raw_writel(0x2, SDRC_CS_CFG); /* 256MB/bank */ +- __raw_writel(SDP_SDRC_MDCFG_0_DDR_XM, SDRC_MCFG_0); +- __raw_writel(SDP_SDRC_MDCFG_0_DDR_XM, SDRC_MCFG_1); +- __raw_writel(MICRON_V_ACTIMA_200, SDRC_ACTIM_CTRLA_0); +- __raw_writel(MICRON_V_ACTIMB_200, SDRC_ACTIM_CTRLB_0); +- __raw_writel(MICRON_V_ACTIMA_200, SDRC_ACTIM_CTRLA_1); +- __raw_writel(MICRON_V_ACTIMB_200, SDRC_ACTIM_CTRLB_1); +- __raw_writel(SDP_3430_SDRC_RFR_CTRL_200MHz, SDRC_RFR_CTRL_0); +- __raw_writel(SDP_3430_SDRC_RFR_CTRL_200MHz, SDRC_RFR_CTRL_1); ++ if (identify_xm_ddr() == MICRON_DDR) { ++ __raw_writel(0x2, SDRC_CS_CFG); /* 256MB/bank */ ++ __raw_writel(SDP_SDRC_MDCFG_0_DDR_MICRON_XM, SDRC_MCFG_0); ++ __raw_writel(SDP_SDRC_MDCFG_0_DDR_MICRON_XM, SDRC_MCFG_1); ++ __raw_writel(MICRON_V_ACTIMA_200, SDRC_ACTIM_CTRLA_0); ++ __raw_writel(MICRON_V_ACTIMB_200, SDRC_ACTIM_CTRLB_0); ++ __raw_writel(MICRON_V_ACTIMA_200, SDRC_ACTIM_CTRLA_1); ++ __raw_writel(MICRON_V_ACTIMB_200, SDRC_ACTIM_CTRLB_1); ++ __raw_writel(SDP_3430_SDRC_RFR_CTRL_200MHz, SDRC_RFR_CTRL_0); ++ __raw_writel(SDP_3430_SDRC_RFR_CTRL_200MHz, SDRC_RFR_CTRL_1); ++ } else { ++ __raw_writel(0x4, SDRC_CS_CFG); /* 512MB/bank */ ++ __raw_writel(SDP_SDRC_MDCFG_0_DDR_NUMONYX_XM, SDRC_MCFG_0); ++ __raw_writel(SDP_SDRC_MDCFG_0_DDR_NUMONYX_XM, SDRC_MCFG_1); ++ __raw_writel(NUMONYX_V_ACTIMA_165, SDRC_ACTIM_CTRLA_0); ++ __raw_writel(NUMONYX_V_ACTIMB_165, SDRC_ACTIM_CTRLB_0); ++ __raw_writel(NUMONYX_V_ACTIMA_165, SDRC_ACTIM_CTRLA_1); ++ __raw_writel(NUMONYX_V_ACTIMB_165, SDRC_ACTIM_CTRLB_1); ++ __raw_writel(SDP_3430_SDRC_RFR_CTRL_165MHz, SDRC_RFR_CTRL_0); ++ __raw_writel(SDP_3430_SDRC_RFR_CTRL_165MHz, SDRC_RFR_CTRL_1); ++ } + } else { + __raw_writel(0x1, SDRC_CS_CFG); /* 128MB/bank */ + __raw_writel(SDP_SDRC_MDCFG_0_DDR, SDRC_MCFG_0); +diff --git a/drivers/k9f1g08r0a.c b/drivers/k9f1g08r0a.c +index 8968a1b..d2da804 100644 +--- a/drivers/k9f1g08r0a.c ++++ b/drivers/k9f1g08r0a.c +@@ -154,6 +154,29 @@ static int NanD_Address(unsigned int numbytes, unsigned long ofs) + return 0; + } + ++int nand_readid(int *mfr, int *id) ++{ ++ NAND_ENABLE_CE(); ++ ++ if (NanD_Command(NAND_CMD_RESET)) { ++ NAND_DISABLE_CE(); ++ return 1; ++ } ++ ++ if (NanD_Command(NAND_CMD_READID)) { ++ NAND_DISABLE_CE(); ++ return 1; ++ } ++ ++ NanD_Address(ADDR_COLUMN, 0); ++ ++ *mfr = READ_NAND(NAND_ADDR); ++ *id = READ_NAND(NAND_ADDR); ++ ++ NAND_DISABLE_CE(); ++ return 0; ++} ++ + /* read chip mfr and id + * return 0 if they match board config + * return 1 if not +@@ -162,23 +185,23 @@ int nand_chip() + { + int mfr, id; + +- NAND_ENABLE_CE(); ++ NAND_ENABLE_CE(); + +- if (NanD_Command(NAND_CMD_RESET)) { +- printf("Err: RESET\n"); +- NAND_DISABLE_CE(); ++ if (NanD_Command(NAND_CMD_RESET)) { ++ printf("Err: RESET\n"); ++ NAND_DISABLE_CE(); + return 1; + } + +- if (NanD_Command(NAND_CMD_READID)) { +- printf("Err: READID\n"); +- NAND_DISABLE_CE(); ++ if (NanD_Command(NAND_CMD_READID)) { ++ printf("Err: READID\n"); ++ NAND_DISABLE_CE(); + return 1; +- } ++ } + +- NanD_Address(ADDR_COLUMN, 0); ++ NanD_Address(ADDR_COLUMN, 0); + +- mfr = READ_NAND(NAND_ADDR); ++ mfr = READ_NAND(NAND_ADDR); + id = READ_NAND(NAND_ADDR); + + NAND_DISABLE_CE(); +diff --git a/include/asm/arch-omap3/mem.h b/include/asm/arch-omap3/mem.h +index cba4c6f..63cdba1 100644 +--- a/include/asm/arch-omap3/mem.h ++++ b/include/asm/arch-omap3/mem.h +@@ -46,6 +46,7 @@ typedef enum { + #define MMC_NAND 4 + #define MMC_ONENAND 5 + #define GPMC_NONE 6 ++#define GPMC_ONENAND_TRY 7 + + #endif + +@@ -71,7 +72,8 @@ typedef enum { + #define SDP_SDRC_MDCFG_0_DDR (0x02582019|B_ALL) /* Infin ddr module */ + #else + #define SDP_SDRC_MDCFG_0_DDR (0x02584019|B_ALL) +-#define SDP_SDRC_MDCFG_0_DDR_XM (0x03588019|B_ALL) ++#define SDP_SDRC_MDCFG_0_DDR_MICRON_XM (0x03588019|B_ALL) ++#define SDP_SDRC_MDCFG_0_DDR_NUMONYX_XM (0x04590019|B_ALL) + #endif + + #define SDP_SDRC_MR_0_DDR 0x00000032 +@@ -252,12 +254,47 @@ typedef enum { + (MICRON_TDPL_200 << 6) | (MICRON_TDAL_200)) + + #define MICRON_TWTR_200 2 +-#define MICRON_TCKE_200 1 ++#define MICRON_TCKE_200 4 + #define MICRON_TXP_200 2 + #define MICRON_XSR_200 23 + #define MICRON_V_ACTIMB_200 ((MICRON_TCKE_200 << 12) | (MICRON_XSR_200 << 0)) | \ + (MICRON_TXP_200 << 8) | (MICRON_TWTR_200 << 16) + ++/* NUMONYX part of IGEP0020 (165MHz optimized) 6.06ns ++ * ACTIMA ++ * TDAL = Twr/Tck + Trp/tck = 15/6 + 18/6 = 2.5 + 3 = 5.5 -> 6 ++ * TDPL (Twr) = 15/6 = 2.5 -> 3 ++ * TRRD = 12/6 = 2 ++ * TRCD = 22.5/6 = 3.75 -> 4 ++ * TRP = 18/6 = 3 ++ * TRAS = 42/6 = 7 ++ * TRC = 60/6 = 10 ++ * TRFC = 140/6 = 23.3 -> 24 ++ * ACTIMB ++ * TWTR = 2 ++ * TCKE = 2 ++ * TXSR = 200/6 = 33.3 -> 34 ++ * TXP = 1.0 + 1.1 = 2.1 -> 3 ¿? ++ */ ++#define NUMONYX_TDAL_165 6 ++#define NUMONYX_TDPL_165 3 ++#define NUMONYX_TRRD_165 2 ++#define NUMONYX_TRCD_165 4 ++#define NUMONYX_TRP_165 3 ++#define NUMONYX_TRAS_165 7 ++#define NUMONYX_TRC_165 10 ++#define NUMONYX_TRFC_165 24 ++#define NUMONYX_V_ACTIMA_165 ((NUMONYX_TRFC_165 << 27) | (NUMONYX_TRC_165 << 22) | (NUMONYX_TRAS_165 << 18) \ ++ | (NUMONYX_TRP_165 << 15) | (NUMONYX_TRCD_165 << 12) |(NUMONYX_TRRD_165 << 9) | \ ++ (NUMONYX_TDPL_165 << 6) | (NUMONYX_TDAL_165)) ++ ++#define NUMONYX_TWTR_165 2 ++#define NUMONYX_TCKE_165 2 ++#define NUMONYX_TXP_165 3 ++#define NUMONYX_XSR_165 34 ++#define NUMONYX_V_ACTIMB_165 ((NUMONYX_TCKE_165 << 12) | (NUMONYX_XSR_165 << 0)) | \ ++ (NUMONYX_TXP_165 << 8) | (NUMONYX_TWTR_165 << 16) ++ + /* New and compatability speed defines */ + #if defined(PRCM_CLK_CFG2_200MHZ) || defined(PRCM_CONFIG_II) || defined(PRCM_CONFIG_5B) + # define L3_100MHZ /* Use with <= 100MHz SDRAM */ +@@ -276,6 +313,8 @@ typedef enum { + #elif defined(L3_165MHZ) + # define MICRON_SDRC_ACTIM_CTRLA_0 MICRON_V_ACTIMA_165 + # define MICRON_SDRC_ACTIM_CTRLB_0 MICRON_V_ACTIMB_165 ++# define NUMONYX_SDRC_ACTIM_CTRLA_0 NUMONYX_V_ACTIMA_165 ++# define NUMONYX_SDRC_ACTIM_CTRLB_0 NUMONYX_V_ACTIMB_165 + #endif + + +-- +1.7.2.3 +