From: Reinhard Meyer Date: Mon, 04 Oct 2010 08:31:17 +0200 Subject: [U-Boot] [PATCH V4 2/2] MTD/SPI: add support for Ramtron FRAMs In-Reply-To: <201009141101.07350.vapier@gentoo.org> References: <1284302113-7939-1-git-send-email-u-boot@emk-elektronik.de> <1284475809-12509-2-git-send-email-u-boot@emk-elektronik.de> <1284475809-12509-3-git-send-email-u-boot@emk-elektronik.de> <201009141101.07350.vapier@gentoo.org> Message-ID: <4CA974B5.8030905@emk-elektronik.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Mike Frysinger, All:) > On Tuesday, September 14, 2010 10:50:09 Reinhard Meyer wrote: >> JEDEC types >> non JEDEC types > > this changelog is useless ... either make it say something, or just leave it > empty > >> +static int ramtron_common(struct spi_flash *flash, >> + u32 offset, size_t len, void *buf, u8 command) >> +{ >> + >> + if (sn->params->addr_len == 3 && sn->params->merge_cmd == 0) { >> + cmd[0] = command; >> + cmd[1] = offset >> 16; >> + cmd[2] = offset >> 8; >> + cmd[3] = offset; >> + cmd_len = 4; >> + } >> + else if (sn->params->addr_len == 2 && sn->params->merge_cmd == 0) { >> + cmd[0] = command; >> + cmd[1] = offset >> 8; >> + cmd[2] = offset; >> + cmd_len = 3; >> + } >> + else { > > i thought i had mentioned this before, but those else statements need cuddling > >> + /* claim the bus */ >> + ret = spi_claim_bus(flash->spi); >> + if (ret) { >> + debug("SF: Unable to claim SPI bus\n"); >> + return ret; >> + } > > i'm thinking we should push the bus claim from the read/write funcs into the > common spi flash layer ... not that this is specific to your flash. we can do > this after yours gets merged. > >> + sn = malloc(sizeof(struct ramtron_spi_fram)); > > sizeof(*sn) > > otherwise, this looks good > -mike I am unsure whether currently I should put further effort into this, because this won't work on architectures with incomplete relocation. The pointers in the "probe" table would need relocation fixups otherwise. Reinhard -------------- next part -------------- A non-text attachment was scrubbed... Name: reinhard_meyer.vcf Type: text/x-vcard Size: 370 bytes Desc: not available Url : http://lists.denx.de/pipermail/u-boot/attachments/20101004/ef09b784/attachment.vcf