os/nandboot-R2_0_4/bootload.c File Reference

#include <linux/types.h>
#include <linux/autoconf.h>
#include "mtd.h"
#include "nand.h"
#include "delay.h"
#include <asm/arch/hwregs/reg_rdwr.h>
#include <asm/arch/hwregs/reg_map.h>
#include <asm/arch/hwregs/pinmux_defs.h>
#include <asm/arch/hwregs/bif_core_defs.h>
#include <asm/arch/hwregs/gio_defs.h>
#include "lib.h"
#include "bootconfig.h"

Include dependency graph for bootload.c:

Go to the source code of this file.

Defines

#define BOOTDEBUG   1
#define MORE_BOOTDEBUG   1
#define NANDRW_READ   0x01
#define NANDRW_WRITE   0x00
#define NANDRW_JFFS2   0x02
#define NANDRW_JFFS2_SKIP   0x04
#define ROUND_DOWN(value, boundary)   ((value) & (~((boundary)-1)))
#define SET_MAGIC_AND_BOOT(ADDR, MAGIC_R8, MAGIC_R12)   __asm__ volatile (" \ move.d " #MAGIC_R8 ", $r8\n\ move.d " #MAGIC_R12 ", $r12\n\ jump %0\n\ nop\n\ " : : "r" (ADDR))
#define BOOT1(ADDR, MAGIC_R8, MAGIC_R12)   SET_MAGIC_AND_BOOT(ADDR, MAGIC_R8, MAGIC_R12);
#define BOOT(ADDR)   BOOT1(ADDR, RAM_INIT_MAGIC, NAND_BOOT_MAGIC);

Functions

mtd_infocrisv32_nand_flash_probe (void)
static int nand_rw (struct mtd_info *mtd, int cmd, size_t start, size_t len, size_t *retlen, u_char *buf)
void bootload (void)

Variables

int _end
int _bss
int _edata


Define Documentation

#define BOOT ( ADDR   )     BOOT1(ADDR, RAM_INIT_MAGIC, NAND_BOOT_MAGIC);

Definition at line 80 of file bootload.c.

Referenced by bootload().

#define BOOT1 ( ADDR,
MAGIC_R8,
MAGIC_R12   )     SET_MAGIC_AND_BOOT(ADDR, MAGIC_R8, MAGIC_R12);

Definition at line 78 of file bootload.c.

#define BOOTDEBUG   1

Definition at line 56 of file bootload.c.

#define MORE_BOOTDEBUG   1

Definition at line 57 of file bootload.c.

#define NANDRW_JFFS2   0x02

Definition at line 64 of file bootload.c.

Referenced by bootload(), and nand_rw().

#define NANDRW_JFFS2_SKIP   0x04

Definition at line 65 of file bootload.c.

Referenced by bootload(), and nand_rw().

#define NANDRW_READ   0x01

Definition at line 62 of file bootload.c.

Referenced by bootload(), and nand_rw().

#define NANDRW_WRITE   0x00

Definition at line 63 of file bootload.c.

Referenced by nand_rw().

#define ROUND_DOWN ( value,
boundary   )     ((value) & (~((boundary)-1)))

Definition at line 67 of file bootload.c.

Referenced by rflflash_nand_rw().

#define SET_MAGIC_AND_BOOT ( ADDR,
MAGIC_R8,
MAGIC_R12   )     __asm__ volatile (" \ move.d " #MAGIC_R8 ", $r8\n\ move.d " #MAGIC_R12 ", $r12\n\ jump %0\n\ nop\n\ " : : "r" (ADDR))

Definition at line 71 of file bootload.c.


Function Documentation

void bootload ( void   ) 

Definition at line 198 of file bootload.c.

References _bss, _edata, _end, BOOT, crisv32_nand_flash_probe(), nand_oobinfo::eccbytes, nand_oobinfo::eccpos, mtd_info::eccsize, mtd_info::ecctype, mtd_info::erasesize, error(), mtd_info::flags, mtd_info::name, nand_rw(), NANDRW_JFFS2, NANDRW_JFFS2_SKIP, NANDRW_READ, mtd_info::oobblock, mtd_info::oobinfo, mtd_info::oobsize, putc(), putnl(), puts(), putx(), serial_init(), mtd_info::size, mtd_info::type, and nand_oobinfo::useecc.

struct mtd_info* crisv32_nand_flash_probe ( void   ) 

Definition at line 125 of file nandflash.c.

References __iomem, ALE_BIT, BY_BIT, CE_BIT, nand_chip::chip_delay, CLE_BIT, nand_chip::cmd_ctrl, crisv32_device_ready(), crisv32_hwcontrol(), crisv32_mtd, nand_chip::dev_ready, nand_chip::ecc, nand_chip::eccmode, GFP_KERNEL, nand_chip::hwcontrol, nand_chip::IO_ADDR_R, nand_chip::IO_ADDR_W, ioremap, iounmap, kfree, kmalloc, memset(), nand_ecc_ctrl::mode, NAND_ECC_SOFT, nand_scan(), NAND_USE_FLASH_BBT, nand_chip::options, port_dummy_addr, and printk.

static int nand_rw ( struct mtd_info mtd,
int  cmd,
size_t  start,
size_t  len,
size_t *  retlen,
u_char *  buf 
) [static]

Definition at line 99 of file bootload.c.

References mtd_info::block_isbad, mtd_info::erasesize, min, n, NANDRW_JFFS2, NANDRW_JFFS2_SKIP, NANDRW_READ, NANDRW_WRITE, putnl(), puts(), putx(), mtd_info::read_ecc, and mtd_info::write_ecc.

Referenced by bootload().


Variable Documentation

int _bss

Referenced by bootload().

int _edata

int _end


Generated on Fri Nov 28 00:08:31 2008 for elphel by  doxygen 1.5.1