Re: [PATCH v4] ARM: dts: r9a06g032-rzn1d400-db: Enable CAN2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Biju,

On Thu, Sep 1, 2022 at 6:29 PM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> Enable CAN2 on RZ/N1-EB board by default.
> Also add a macro to enable CAN1, if the board
> support it.
>
> Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> ---
> v3->v4:
>  * Updated commit descriptiom
>  * Enabled CAN2 by default
>  * Added a macro BOARD_HAS_CAN1_ENABLED to configure CAN1,
>    if the board supports it.

Thanks for the update!

> --- a/arch/arm/boot/dts/r9a06g032-rzn1d400-db.dts
> +++ b/arch/arm/boot/dts/r9a06g032-rzn1d400-db.dts
> @@ -26,6 +26,22 @@ aliases {
>         };
>  };
>
> +#if BOARD_HAS_CAN1_ENABLED /* CN10 on RZ/N1-EB board */
> +&can0 {
> +       pinctrl-0 = <&pins_can0>;
> +       pinctrl-names = "default";
> +
> +       status = "okay";
> +};
> +#endif
> +
> +&can1 {
> +       pinctrl-0 = <&pins_can1>;
> +       pinctrl-names = "default";
> +
> +       status = "okay";
> +};

AFAIU, CN10 and CN11 are not the real CAN connectors, they are headers
to add jumpers to select which CAN interface to route to the real CAN
connector J16.

Hence I was thinking of something along the line:

    #ifdef BOARD_HAS_CAN1_ENABLED
    &can0 {
           pinctrl-0 = <&pins_can0>;
           pinctrl-names = "default";

           status = "okay";
    };
    #else
    &can1 {
           pinctrl-0 = <&pins_can1>;
           pinctrl-names = "default";

           status = "okay";
    };
    #endif

or:

   &can0 {
           pinctrl-0 = <&pins_can0>;
           pinctrl-names = "default";

           /* Assuming CN10/CN11 are wired for CAN1 */
           status = "okay";
    };

    &can1 {
           pinctrl-0 = <&pins_can1>;
           pinctrl-names = "default";

           /* Please only enable can0 or can1, depending on CN10/CN11 */
           /* status = "okay"; */
    };


Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux