On Jul 7, 2011, at 4:28 PM, Mike Frysinger wrote:
> On Thu, Jul 7, 2011 at 16:47, Jonathan Stroud wrote:
>> +_URJ_BUS(spimem)
>
> how about just plain "spi" ?
Fine. I globally replaced spimem with spi.
>> +#define ASHIFT ((bus_params_t *) bus->params)->ashift
>> +#define DSHIFT ((bus_params_t *) bus->params)->dshift
>
> i'm not grasping why the shift info needs to be in the SPI bus layer.
> could you elaborate on that ?
Defines the number off address and data bytes that the device expects. You can
set this when you initialize the bus. This is similar to the prototype bus
where you
tell it the size of the address bus and data buses.
>
>> + bus = calloc (1, sizeof (urj_bus_t));
>> + if (!bus)
>> + return NULL;
>> +
>> + bus = urj_bus_generic_new (chain, driver, sizeof (bus_params_t));
>
> pretty sure that first calloc() should be deleted
You are right. It gets allocated by the new function.
>> + case 0: // "auto"
>> + ASHIFT = 1;
>> + break;
>
> we should be able to figure out the address shift based on the flash
> type. although every one
Not all devices provide this information. Easier just to tell the bus driver
how to operate. This
matches the behavior of the prototype bus driver.
>> + CS = SCK = MOSI = MISO = NULL;
>
> i think the previous suggestion of defaulting to "CS", "SCK", "MOSI",
> and "MISO" is missing
Frick... I put that in. Then missed it when I merged my code back to mainline.
Adding it back to the next patch.
I have a local branch with many more mods. This is why I have made some
mistakes merging. Trying to be careful.
>
>
>> + asize = (uint64_t)1<<asize;
>
> spaces around the "<<"
nothing gets past you. its hard to code in someone else's style when you code
in another all the time.
>> + spimem_write_byte (bus, (uint8_t)(data));
>
> no need for the uint8_t cast
Its a uint32_t getting passed to a uint8_t. I would prefer to have it, but if
you really want it gone, fine.
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development