RE: [PATCH v5 06/14] ARM: OMAP2+: gpmc: CS configuration helper

2012-06-14 Thread Mohammed, Afzal
Hi Jon, On Wed, Jun 13, 2012 at 21:09:52, Hunter, Jon wrote: Sure, but reviewing the function it still looks odd from a readability standpoint. At least it made me think what is going on here So a comment is definitely needed. 2. A bad setting in the configuration passed.

Re: [PATCH v5 06/14] ARM: OMAP2+: gpmc: CS configuration helper

2012-06-13 Thread Jon Hunter
Hi Afzal, On 06/13/2012 12:50 AM, Mohammed, Afzal wrote: Hi Jon, On Tue, Jun 12, 2012 at 23:39:32, Hunter, Jon wrote: On 06/12/2012 07:58 AM, Mohammed, Afzal wrote: Thinking again over it, I am feeling above is sufficient, reason same as said earlier, to keep code simple currently this

RE: [PATCH v5 06/14] ARM: OMAP2+: gpmc: CS configuration helper

2012-06-12 Thread Mohammed, Afzal
Hi Jon, On Tue, Jun 12, 2012 at 03:13:02, Hunter, Jon wrote: +static void gpmc_setup_cs_config(unsigned cs, unsigned conf) +{ + u32 l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); Why is it necessary to read the register first? I thought you wanted to get away from relying on bootloader

RE: [PATCH v5 06/14] ARM: OMAP2+: gpmc: CS configuration helper

2012-06-12 Thread Mohammed, Afzal
Hi Jon, On Tue, Jun 12, 2012 at 14:10:08, Mohammed, Afzal wrote: + l |= conf GPMC_CONFIG1_DEVICETYPE_NAND; + l |= conf GPMC_CONFIG1_DEVICESIZE_16; I can see that it works to use the above definitions as masks because of the possible values that can be programmed into these fields.

Re: [PATCH v5 06/14] ARM: OMAP2+: gpmc: CS configuration helper

2012-06-12 Thread Jon Hunter
On 06/12/2012 03:40 AM, Mohammed, Afzal wrote: Hi Jon, On Tue, Jun 12, 2012 at 03:13:02, Hunter, Jon wrote: +static void gpmc_setup_cs_config(unsigned cs, unsigned conf) +{ + u32 l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); Why is it necessary to read the register first? I thought you

Re: [PATCH v5 06/14] ARM: OMAP2+: gpmc: CS configuration helper

2012-06-12 Thread Jon Hunter
On 06/12/2012 07:58 AM, Mohammed, Afzal wrote: Hi Jon, On Tue, Jun 12, 2012 at 14:10:08, Mohammed, Afzal wrote: + l |= conf GPMC_CONFIG1_DEVICETYPE_NAND; + l |= conf GPMC_CONFIG1_DEVICESIZE_16; I can see that it works to use the above definitions as masks because of the possible

RE: [PATCH v5 06/14] ARM: OMAP2+: gpmc: CS configuration helper

2012-06-12 Thread Mohammed, Afzal
Hi Jon, On Tue, Jun 12, 2012 at 23:36:17, Hunter, Jon wrote: Well it is unclear what the code flow is for using this helper as this change simply adds the helper. If someone other function is writing to the CONFIG1 register before this function, then you may wish to highlight the programming

RE: [PATCH v5 06/14] ARM: OMAP2+: gpmc: CS configuration helper

2012-06-12 Thread Mohammed, Afzal
Hi Jon, On Tue, Jun 12, 2012 at 23:39:32, Hunter, Jon wrote: On 06/12/2012 07:58 AM, Mohammed, Afzal wrote: Thinking again over it, I am feeling above is sufficient, reason same as said earlier, to keep code simple currently this is sufficient to handle GPMC bit patterns for IPs