/***************************************************************************** * TS-78xx Info
****************************************************************************/
/* * FPGA - lives where the PCI bus would be at ORION5X_PCI_MEM_PHYS_BASE
*/ #define TS78XX_FPGA_REGS_PHYS_BASE 0xe8000000 #define TS78XX_FPGA_REGS_VIRT_BASE IOMEM(0xff900000) #define TS78XX_FPGA_REGS_SIZE SZ_1M
/* * hardware specific access to control-lines * * ctrl: * NAND_NCE: bit 0 -> bit 2 * NAND_CLE: bit 1 -> bit 1 * NAND_ALE: bit 2 -> bit 0
*/ staticvoid ts78xx_ts_nand_cmd_ctrl(struct nand_chip *this, int cmd, unsignedint ctrl)
{ if (ctrl & NAND_CTRL_CHANGE) { unsignedchar bits;
staticstruct platform_nand_data ts78xx_ts_nand_data = {
.chip = {
.nr_chips = 1,
.partitions = ts78xx_ts_nand_parts,
.nr_partitions = ARRAY_SIZE(ts78xx_ts_nand_parts),
.chip_delay = 15,
.bbt_options = NAND_BBT_USE_FLASH,
},
.ctrl = { /* * The HW ECC offloading functions, used to give about a 9% * performance increase for 'dd if=/dev/mtdblockX' and 5% for * nanddump. This all however was changed by git commit * e6cf5df1838c28bb060ac45b5585e48e71bbc740 so now there is * no performance advantage to be had so we no longer bother
*/
.cmd_ctrl = ts78xx_ts_nand_cmd_ctrl,
.dev_ready = ts78xx_ts_nand_dev_ready,
.write_buf = ts78xx_ts_nand_write_buf,
.read_buf = ts78xx_ts_nand_read_buf,
},
};
staticvoid ts78xx_fpga_supports(void)
{ /* TODO: put this 'table' into ts78xx-fpga.h */ switch (ts78xx_fpga.id) { case TS7800_REV_1: case TS7800_REV_2: case TS7800_REV_3: case TS7800_REV_4: case TS7800_REV_5: case TS7800_REV_6: case TS7800_REV_7: case TS7800_REV_8: case TS7800_REV_9:
ts78xx_fpga.supports.ts_rtc.present = 1;
ts78xx_fpga.supports.ts_nand.present = 1;
ts78xx_fpga.supports.ts_rng.present = 1; break; default: /* enable devices if magic matches */ switch ((ts78xx_fpga.id >> 8) & 0xffffff) { case TS7800_FPGA_MAGIC:
pr_warn("unrecognised FPGA revision 0x%.2x\n",
ts78xx_fpga.id & 0xff);
ts78xx_fpga.supports.ts_rtc.present = 1;
ts78xx_fpga.supports.ts_nand.present = 1;
ts78xx_fpga.supports.ts_rng.present = 1; break; default:
ts78xx_fpga.supports.ts_rtc.present = 0;
ts78xx_fpga.supports.ts_nand.present = 0;
ts78xx_fpga.supports.ts_rng.present = 0;
}
}
}
staticint ts78xx_fpga_load_devices(void)
{ int tmp, ret = 0;
if (ts78xx_fpga.supports.ts_rtc.present == 1) {
tmp = ts78xx_ts_rtc_load(); if (tmp)
ts78xx_fpga.supports.ts_rtc.present = 0;
ret |= tmp;
} if (ts78xx_fpga.supports.ts_nand.present == 1) {
tmp = ts78xx_ts_nand_load(); if (tmp)
ts78xx_fpga.supports.ts_nand.present = 0;
ret |= tmp;
} if (ts78xx_fpga.supports.ts_rng.present == 1) {
tmp = ts78xx_ts_rng_load(); if (tmp)
ts78xx_fpga.supports.ts_rng.present = 0;
ret |= tmp;
}
return ret;
}
staticint ts78xx_fpga_unload_devices(void)
{
if (ts78xx_fpga.supports.ts_rtc.present == 1)
ts78xx_ts_rtc_unload(); if (ts78xx_fpga.supports.ts_nand.present == 1)
ts78xx_ts_nand_unload(); if (ts78xx_fpga.supports.ts_rng.present == 1)
ts78xx_ts_rng_unload();
/* * There does not seem to be a feasible way to block access to the GPIO * pins from userspace (/dev/mem). This if clause should hopefully warn * those foolish enough not to follow 'policy' :) * * UrJTAG SVN since r1381 can be used to reprogram the FPGA
*/ if (ts78xx_fpga.id != fpga_id) {
pr_err("FPGA magic/rev mismatch\n" "TS-78xx FPGA: was 0x%.6x/%.2x but now 0x%.6x/%.2x\n",
(ts78xx_fpga.id >> 8) & 0xffffff, ts78xx_fpga.id & 0xff,
(fpga_id >> 8) & 0xffffff, fpga_id & 0xff);
ts78xx_fpga.state = -1; return -EBUSY;
}
if (ts78xx_fpga_unload_devices()) {
ts78xx_fpga.state = -1; return -EBUSY;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.