All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/2] arm: sunxi: twi: enable clock for sun7i
@ 2015-12-03 16:49 Olliver Schinagl
  2015-12-03 16:49 ` [U-Boot] [PATCH 1/2] sunxi: twi: enable clocks on sun7i Olliver Schinagl
  2015-12-03 16:49 ` [U-Boot] [PATCH 2/2] sun4i: clock: cleanup some whitespace errors Olliver Schinagl
  0 siblings, 2 replies; 8+ messages in thread
From: Olliver Schinagl @ 2015-12-03 16:49 UTC (permalink / raw)
  To: u-boot

From: Olliver Schinagl <o.schinagl@ultimaker.com>

Paul enabled all I2C ports for sunxi but forgot the clock on twi 4 and 5 for sun7i.

And a small non code changing whitespace fix

Tested on Olimex Lime2

Olliver Schinagl (2):
  sunxi: twi: enable clocks on sun7i
  sun4i: clock: cleanup some whitespace errors

 arch/arm/cpu/armv7/sunxi/clock_sun4i.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

-- 
2.6.2

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 1/2] sunxi: twi: enable clocks on sun7i
  2015-12-03 16:49 [U-Boot] [PATCH 0/2] arm: sunxi: twi: enable clock for sun7i Olliver Schinagl
@ 2015-12-03 16:49 ` Olliver Schinagl
  2015-12-03 22:57   ` [U-Boot] [linux-sunxi] " Julian Calaby
  2015-12-10 11:32   ` [U-Boot] " Hans de Goede
  2015-12-03 16:49 ` [U-Boot] [PATCH 2/2] sun4i: clock: cleanup some whitespace errors Olliver Schinagl
  1 sibling, 2 replies; 8+ messages in thread
From: Olliver Schinagl @ 2015-12-03 16:49 UTC (permalink / raw)
  To: u-boot

From: Olliver Schinagl <o.schinagl@ultimaker.com>

Commit 6c739c5d added code to enable i2c bus 4 and 5 on the sun7i SoC
but forgot to enable the clocks for these 2 i2c busses.

This patch enables the clocks for i2c bus 4 and 5 on sun7i.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
---
 arch/arm/cpu/armv7/sunxi/clock_sun4i.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
index 7c8eff9..ed910b1 100644
--- a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
+++ b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
@@ -67,7 +67,11 @@ int clock_twi_onoff(int port, int state)
 	struct sunxi_ccm_reg *const ccm =
 		(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
 
+#ifdef CONFIG_MACH_SUN7I
+	if (port > 4)
+#else
 	if (port > 2)
+#endif
 		return -1;
 
 	/* set the apb clock gate for twi */
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 2/2] sun4i: clock: cleanup some whitespace errors
  2015-12-03 16:49 [U-Boot] [PATCH 0/2] arm: sunxi: twi: enable clock for sun7i Olliver Schinagl
  2015-12-03 16:49 ` [U-Boot] [PATCH 1/2] sunxi: twi: enable clocks on sun7i Olliver Schinagl
@ 2015-12-03 16:49 ` Olliver Schinagl
  2015-12-10 11:32   ` Hans de Goede
  1 sibling, 1 reply; 8+ messages in thread
From: Olliver Schinagl @ 2015-12-03 16:49 UTC (permalink / raw)
  To: u-boot

From: Olliver Schinagl <o.schinagl@ultimaker.com>

Add some spaces around operators.

Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
---
 arch/arm/cpu/armv7/sunxi/clock_sun4i.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
index ed910b1..866b2d6 100644
--- a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
+++ b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
@@ -59,7 +59,7 @@ void clock_init_uart(void)
 
 	/* open the clock for uart */
 	setbits_le32(&ccm->apb1_gate,
-		CLK_GATE_OPEN << (APB1_GATE_UART_SHIFT+CONFIG_CONS_INDEX-1));
+		CLK_GATE_OPEN << (APB1_GATE_UART_SHIFT+CONFIG_CONS_INDEX - 1));
 }
 
 int clock_twi_onoff(int port, int state)
@@ -77,10 +77,10 @@ int clock_twi_onoff(int port, int state)
 	/* set the apb clock gate for twi */
 	if (state)
 		setbits_le32(&ccm->apb1_gate,
-			     CLK_GATE_OPEN << (APB1_GATE_TWI_SHIFT+port));
+			     CLK_GATE_OPEN << (APB1_GATE_TWI_SHIFT + port));
 	else
 		clrbits_le32(&ccm->apb1_gate,
-			     CLK_GATE_OPEN << (APB1_GATE_TWI_SHIFT+port));
+			     CLK_GATE_OPEN << (APB1_GATE_TWI_SHIFT + port));
 
 	return 0;
 }
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [linux-sunxi] [PATCH 1/2] sunxi: twi: enable clocks on sun7i
  2015-12-03 16:49 ` [U-Boot] [PATCH 1/2] sunxi: twi: enable clocks on sun7i Olliver Schinagl
@ 2015-12-03 22:57   ` Julian Calaby
  2015-12-03 23:01     ` Julian Calaby
  2015-12-10 11:32   ` [U-Boot] " Hans de Goede
  1 sibling, 1 reply; 8+ messages in thread
From: Julian Calaby @ 2015-12-03 22:57 UTC (permalink / raw)
  To: u-boot

Hi Oliver,

On Fri, Dec 4, 2015 at 3:49 AM, Olliver Schinagl <oliver@schinagl.nl> wrote:
> From: Olliver Schinagl <o.schinagl@ultimaker.com>
>
> Commit 6c739c5d added code to enable i2c bus 4 and 5 on the sun7i SoC
> but forgot to enable the clocks for these 2 i2c busses.
>
> This patch enables the clocks for i2c bus 4 and 5 on sun7i.
>
> Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
> ---
>  arch/arm/cpu/armv7/sunxi/clock_sun4i.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
> index 7c8eff9..ed910b1 100644
> --- a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
> +++ b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
> @@ -67,7 +67,11 @@ int clock_twi_onoff(int port, int state)
>         struct sunxi_ccm_reg *const ccm =
>                 (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
>
> +#ifdef CONFIG_MACH_SUN7I
> +       if (port > 4)
> +#else
>         if (port > 2)
> +#endif

Should the number here be a #define somewhere, or even a parameter for
each version of this clock?

Thanks,

-- 
Julian Calaby

Email: julian.calaby at gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [linux-sunxi] [PATCH 1/2] sunxi: twi: enable clocks on sun7i
  2015-12-03 22:57   ` [U-Boot] [linux-sunxi] " Julian Calaby
@ 2015-12-03 23:01     ` Julian Calaby
  2015-12-04  7:32       ` Olliver Schinagl
  0 siblings, 1 reply; 8+ messages in thread
From: Julian Calaby @ 2015-12-03 23:01 UTC (permalink / raw)
  To: u-boot

Hi Oliver,

On Fri, Dec 4, 2015 at 9:57 AM, Julian Calaby <julian.calaby@gmail.com> wrote:
> Hi Oliver,
>
> On Fri, Dec 4, 2015 at 3:49 AM, Olliver Schinagl <oliver@schinagl.nl> wrote:
>> From: Olliver Schinagl <o.schinagl@ultimaker.com>
>>
>> Commit 6c739c5d added code to enable i2c bus 4 and 5 on the sun7i SoC
>> but forgot to enable the clocks for these 2 i2c busses.
>>
>> This patch enables the clocks for i2c bus 4 and 5 on sun7i.
>>
>> Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
>> ---
>>  arch/arm/cpu/armv7/sunxi/clock_sun4i.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
>> index 7c8eff9..ed910b1 100644
>> --- a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
>> +++ b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
>> @@ -67,7 +67,11 @@ int clock_twi_onoff(int port, int state)
>>         struct sunxi_ccm_reg *const ccm =
>>                 (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
>>
>> +#ifdef CONFIG_MACH_SUN7I
>> +       if (port > 4)
>> +#else
>>         if (port > 2)
>> +#endif
>
> Should the number here be a #define somewhere, or even a parameter for
> each version of this clock?

Wait, this is a u-boot patch, right? If so, ignore this and sorry for the noise.

Thanks,

-- 
Julian Calaby

Email: julian.calaby at gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [linux-sunxi] [PATCH 1/2] sunxi: twi: enable clocks on sun7i
  2015-12-03 23:01     ` Julian Calaby
@ 2015-12-04  7:32       ` Olliver Schinagl
  0 siblings, 0 replies; 8+ messages in thread
From: Olliver Schinagl @ 2015-12-04  7:32 UTC (permalink / raw)
  To: u-boot

Hey Julian

On December 4, 2015 12:01:27 AM CET, Julian Calaby <julian.calaby@gmail.com> wrote:
>Hi Oliver,
>
>On Fri, Dec 4, 2015 at 9:57 AM, Julian Calaby <julian.calaby@gmail.com>
>wrote:
>> Hi Oliver,
>>
>> On Fri, Dec 4, 2015 at 3:49 AM, Olliver Schinagl <oliver@schinagl.nl>
>wrote:
>>> From: Olliver Schinagl <o.schinagl@ultimaker.com>
>>>
>>> Commit 6c739c5d added code to enable i2c bus 4 and 5 on the sun7i
>SoC
>>> but forgot to enable the clocks for these 2 i2c busses.
>>>
>>> This patch enables the clocks for i2c bus 4 and 5 on sun7i.
>>>
>>> Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
>>> ---
>>>  arch/arm/cpu/armv7/sunxi/clock_sun4i.c | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
>b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
>>> index 7c8eff9..ed910b1 100644
>>> --- a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
>>> +++ b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
>>> @@ -67,7 +67,11 @@ int clock_twi_onoff(int port, int state)
>>>         struct sunxi_ccm_reg *const ccm =
>>>                 (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
>>>
>>> +#ifdef CONFIG_MACH_SUN7I
>>> +       if (port > 4)
>>> +#else
>>>         if (port > 2)
>>> +#endif
>>
>> Should the number here be a #define somewhere, or even a parameter
>for
>> each version of this clock?
>
>Wait, this is a u-boot patch, right? If so, ignore this and sorry for
>the noise.
It is ;) and whille you are not un-right i dont think u-boot does this via defined variables generally. But I  personally do like it better with defines. If there is a v2 I will actually change it :)
>
>Thanks,

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 1/2] sunxi: twi: enable clocks on sun7i
  2015-12-03 16:49 ` [U-Boot] [PATCH 1/2] sunxi: twi: enable clocks on sun7i Olliver Schinagl
  2015-12-03 22:57   ` [U-Boot] [linux-sunxi] " Julian Calaby
@ 2015-12-10 11:32   ` Hans de Goede
  1 sibling, 0 replies; 8+ messages in thread
From: Hans de Goede @ 2015-12-10 11:32 UTC (permalink / raw)
  To: u-boot

Hi,

On 12/03/2015 05:49 PM, Olliver Schinagl wrote:
> From: Olliver Schinagl <o.schinagl@ultimaker.com>
>
> Commit 6c739c5d added code to enable i2c bus 4 and 5 on the sun7i SoC
> but forgot to enable the clocks for these 2 i2c busses.
>
> This patch enables the clocks for i2c bus 4 and 5 on sun7i.
>
> Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
> ---
>   arch/arm/cpu/armv7/sunxi/clock_sun4i.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
> index 7c8eff9..ed910b1 100644
> --- a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
> +++ b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
> @@ -67,7 +67,11 @@ int clock_twi_onoff(int port, int state)
>   	struct sunxi_ccm_reg *const ccm =
>   		(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
>
> +#ifdef CONFIG_MACH_SUN7I
> +	if (port > 4)
> +#else
>   	if (port > 2)
> +#endif
>   		return -1;
>
>   	/* set the apb clock gate for twi */

The range-check is not needed at all, since clock_twi_onoff only gets
called with such high indexes when CONFIG_I2C3_ENABLE / CONFIG_I2C4_ENABLE
is set and Kconfig already only allows these on sun6i / sun7i.

So I've applied a modified version of your patch which simply removes the
range-check all-together.

Regards,

Hans

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 2/2] sun4i: clock: cleanup some whitespace errors
  2015-12-03 16:49 ` [U-Boot] [PATCH 2/2] sun4i: clock: cleanup some whitespace errors Olliver Schinagl
@ 2015-12-10 11:32   ` Hans de Goede
  0 siblings, 0 replies; 8+ messages in thread
From: Hans de Goede @ 2015-12-10 11:32 UTC (permalink / raw)
  To: u-boot

Hi,

On 12/03/2015 05:49 PM, Olliver Schinagl wrote:
> From: Olliver Schinagl <o.schinagl@ultimaker.com>
>
> Add some spaces around operators.
>
> Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>

Thanks, applied.

Regards,

Hans


> ---
>   arch/arm/cpu/armv7/sunxi/clock_sun4i.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
> index ed910b1..866b2d6 100644
> --- a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
> +++ b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
> @@ -59,7 +59,7 @@ void clock_init_uart(void)
>
>   	/* open the clock for uart */
>   	setbits_le32(&ccm->apb1_gate,
> -		CLK_GATE_OPEN << (APB1_GATE_UART_SHIFT+CONFIG_CONS_INDEX-1));
> +		CLK_GATE_OPEN << (APB1_GATE_UART_SHIFT+CONFIG_CONS_INDEX - 1));
>   }
>
>   int clock_twi_onoff(int port, int state)
> @@ -77,10 +77,10 @@ int clock_twi_onoff(int port, int state)
>   	/* set the apb clock gate for twi */
>   	if (state)
>   		setbits_le32(&ccm->apb1_gate,
> -			     CLK_GATE_OPEN << (APB1_GATE_TWI_SHIFT+port));
> +			     CLK_GATE_OPEN << (APB1_GATE_TWI_SHIFT + port));
>   	else
>   		clrbits_le32(&ccm->apb1_gate,
> -			     CLK_GATE_OPEN << (APB1_GATE_TWI_SHIFT+port));
> +			     CLK_GATE_OPEN << (APB1_GATE_TWI_SHIFT + port));
>
>   	return 0;
>   }
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-12-10 11:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-03 16:49 [U-Boot] [PATCH 0/2] arm: sunxi: twi: enable clock for sun7i Olliver Schinagl
2015-12-03 16:49 ` [U-Boot] [PATCH 1/2] sunxi: twi: enable clocks on sun7i Olliver Schinagl
2015-12-03 22:57   ` [U-Boot] [linux-sunxi] " Julian Calaby
2015-12-03 23:01     ` Julian Calaby
2015-12-04  7:32       ` Olliver Schinagl
2015-12-10 11:32   ` [U-Boot] " Hans de Goede
2015-12-03 16:49 ` [U-Boot] [PATCH 2/2] sun4i: clock: cleanup some whitespace errors Olliver Schinagl
2015-12-10 11:32   ` Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.