[flashrom] [PATCH 11/12] add support for Intel Hardware Sequencing

David Hendricks dhendrix at google.com
Mon Jun 20 20:54:45 CEST 2011


On Tue, Jun 7, 2011 at 7:55 PM, Stefan Tauner <
stefan.tauner at student.tuwien.ac.at> wrote:

> +static uint32_t ich_hwseq_get_erase_block_size(unsigned int addr)
> +{
> +       REGWRITE32(ICH9_REG_FADDR, (addr & 0x00FFFFFF));
> +       uint8_t enc_berase = (REGREAD16(ICH9_REG_HSFS) & HSFS_BERASE) >>
> +                                  HSFS_BERASE_OFF;
> +       const uint32_t dec_berase[4] = {
> +               256,
> +               4 * 1024,
> +               8 * 1024,
> +               64 * 1024
> +       };
>
+       return dec_berase[enc_berase];
>

Others might want to comment, but I think you should avoid doing all that
work in the variable declaration area.


> +}
> +
> +int ich_hwseq_probe(struct flashchip *flash)
> +{
> +       uint32_t total_size, boundary;
> +       uint32_t erase_size_low, size_low, erase_size_high, size_high;
> +       struct block_eraser eraser;
>

This should be a pointer, right? I am assuming you intended to directly
update the flash->block_erasers[0] member later in this function.

-- 
David Hendricks (dhendrix)
Systems Software Engineer, Google Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.flashrom.org/pipermail/flashrom/attachments/20110620/331e96f5/attachment.html>


More information about the flashrom mailing list