diff mbox

[v3] ARM: at91: add Acme Systems Aria G25 board

Message ID 515DB248.6070105@interlog.com (mailing list archive)
State New, archived
Headers show

Commit Message

Douglas Gilbert April 4, 2013, 5:03 p.m. UTC
On 13-04-04 11:42 AM, Nicolas Ferre wrote:
> From: Douglas Gilbert <dgilbert@interlog.com>
>
> Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> Hi all,
>
> Here is the third revision of this patch. I plan to include it in a
> pull-request real-soon-now!
>
> v3: - move to "at91-" prefix for .dts[i] files
>      - remove the rtc activation code because of the ongoing discussions
>        about this IP and its DT binding.
>

Nicolas,
It's a pity that the rtc activation code is removed.
At worst:
                         rtc@fffffeb0 {
                                 status = "okay";
                         };

does nothing. Also it is unlikely to be changed by any
movement on the rtc-at91rm9200 front.


The lack of use of uart1 is for my own, private reasons.
I think it would be more generally useful to show uart1's
definition and disable it as shown in the attached patch
fragment.


I also note that my date line was removed. I like dates,
so when I add comments like "the i2c-at91 driver is broken
for the SAM9G20 ** and use the i2c-gpio driver instead" then
this is not taken as an eternal truth. It worked in the
past and hopefully it will work again in the future.

While on the subject of I2C, I'm getting tired of seeing
this oft-copied line:
    i2c-gpio,delay-us = <2>;        /* ~100 kHz */

It is the clock half period in microseconds and for the 100 kHz
(standard) I2C clock speed, it should be 5. Due to rounding
(up) that gives a measured clock speed of around 88 kHz on
my equipment. Crappy I2C devices *** seem to cope better
with 12% below the standard clock frequency than 80% above
it.

Doug Gilbert

** broken in my tests on the FoxG20 with lk 3.9.0-rc5

*** if my experience is anything to go by there are many
     dodgy I2C devices, probably using I2C bit banging
     code borrowed from Wikipedia.

Comments

Nicolas Ferre April 18, 2013, 9:01 a.m. UTC | #1
On 04/04/2013 07:03 PM, Douglas Gilbert :
> On 13-04-04 11:42 AM, Nicolas Ferre wrote:
>> From: Douglas Gilbert <dgilbert@interlog.com>
>>
>> Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
>> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>> ---
>> Hi all,
>>
>> Here is the third revision of this patch. I plan to include it in a
>> pull-request real-soon-now!
>>
>> v3: - move to "at91-" prefix for .dts[i] files
>>      - remove the rtc activation code because of the ongoing discussions
>>        about this IP and its DT binding.
>>
> 
> Nicolas,
> It's a pity that the rtc activation code is removed.
> At worst:
>                         rtc@fffffeb0 {
>                                 status = "okay";
>                         };

I try to re-enalbe it when the at91sam9x5.dtsi exposes a compatibility
sting != at91rm9200-rtc

will soon appear on mailing-list.

> does nothing. Also it is unlikely to be changed by any
> movement on the rtc-at91rm9200 front.
> 
> 
> The lack of use of uart1 is for my own, private reasons.
> I think it would be more generally useful to show uart1's
> definition and disable it as shown in the attached patch
> fragment.

Well, if uart1 is available on Aria board, I should enable it! If you do
not want it on your own design, you must modify the .dts yourself. So I
plan to have an "okay" status on it (and move the definition itself to
the generic .dtsi).


> I also note that my date line was removed. I like dates,
> so when I add comments like "the i2c-at91 driver is broken
> for the SAM9G20 ** and use the i2c-gpio driver instead" then
> this is not taken as an eternal truth.

Yep, I see, but I try to cleanup the patch as much as I can. If you want
it untouched, provide me a standard formated patch.

> It worked in the
> past and hopefully it will work again in the future.
> 
> While on the subject of I2C, I'm getting tired of seeing
> this oft-copied line:
>    i2c-gpio,delay-us = <2>;        /* ~100 kHz */
> 
> It is the clock half period in microseconds and for the 100 kHz
> (standard) I2C clock speed, it should be 5. Due to rounding
> (up) that gives a measured clock speed of around 88 kHz on
> my equipment. Crappy I2C devices *** seem to cope better
> with 12% below the standard clock frequency than 80% above
> it.

Makes sense: I keep it in mind. In parallel, it can be interesting if
you can send me a patch with all these mistakes corrected ;-)

Bye,
Nicolas Ferre April 18, 2013, 10:13 a.m. UTC | #2
On 04/18/2013 11:01 AM, Nicolas Ferre :
> On 04/04/2013 07:03 PM, Douglas Gilbert :

[..]

>> The lack of use of uart1 is for my own, private reasons.
>> I think it would be more generally useful to show uart1's
>> definition and disable it as shown in the attached patch
>> fragment.
> 
> Well, if uart1 is available on Aria board, I should enable it! If you do
> not want it on your own design, you must modify the .dts yourself. So I
> plan to have an "okay" status on it (and move the definition itself to
> the generic .dtsi).

Update: I have just checked the ACME website and both UART0 and UART1
pins are expected to be used as GPIOs. So maybe we should mark them as
"disabled":

+                       /*
+                        * UART1 pins are marked as GPIO on Aria
+                        * documentation: change to "okay" if you need
+                        * an additional serial port
+                        */
+                       uart0: serial@f8040000 {
+                               status = "disabled";
+                       };
+
+                       uart1: serial@f8044000 {
+                               status = "disabled";
+                       };

(uart0 definition moved to at91sam9x5.dtsi)
What do you think?

[..]

Bye,
diff mbox

Patch

--- a/arch/arm/boot/dts/ariag25.dts_orig	2013-04-04 11:58:40.518122816 -0400
+++ b/arch/arm/boot/dts/at91-ariag25.dts	2013-04-03 15:23:09.240385849 -0400
@@ -1,5 +1,5 @@ 
 /*
- * ariag25.dts - Device Tree file for Acme Systems Aria G25 (AT91SAM9G25 based)
+ * at91-ariag25.dts - Device Tree file for Acme Systems Aria G25 (AT91SAM9G25 based)
  *
  * Copyright (C) 2013 Douglas Gilbert <dgilbert@interlog.com>,
  *                    Robert Nelson <robertcnelson@gmail.com>
@@ -21,6 +21,7 @@ 
 		serial3 = &usart2;
 		serial4 = &usart3;
 		serial5 = &uart0;
+		serial6 = &uart1;
 	};
 
 	chosen {
@@ -121,6 +122,16 @@ 
 				status = "okay";
 			};
 
+			uart1: serial@f8044000 {
+				compatible = "atmel,at91sam9260-usart";
+				reg = <0xf8044000 0x200>;
+				interrupts = <16 4 5>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_uart1>;
+				/* Remove following or change to "okay" if wanted */
+				status = "disabled";
+			};
+
 			spi0: spi@f0000000 {
 				status = "okay";
 				cs-gpios = <&pioA 14 0>, <0>, <0>, <0>;