[PATCH linux dev-4.10 v2] ARM: aspeed: Add Mellanox MSN machine

Andrew Jeffery andrew at aj.id.au
Tue May 30 13:08:46 AEST 2017


Hi Mykola,

On Mon, 2017-05-29 at 11:23 +0000, Mykola Kostenok wrote:
> > -----Original Message-----
> > > > > > From: joel.stan at gmail.com [mailto:joel.stan at gmail.com] On Behalf Of Joel
> > Stanley
> > Sent: Friday, May 26, 2017 7:43 AM
> > > > To: Mykola Kostenok <c_mykolak at mellanox.com>; Cédric Le Goater
> > > > > > <clg at kaod.org>; Andrew Jeffery <andrew at aj.id.au>
> > > > Cc: OpenBMC Maillist <openbmc at lists.ozlabs.org>
> > Subject: Re: [PATCH linux dev-4.10 v2] ARM: aspeed: Add Mellanox MSN
> > machine
> > 
> > Andrew, can you please review the pinmux-y bits?
> > 
> > Cedric, can you double check the mtd bits?
> > 

...

> > > +
> > > > > > +               host_pnor: spi2 at 1e631000 {
> > > +                       reg = < 0x1e631000 0xc4
> > > +                               0x38000000 0x08000000 >;
> > > +                       #address-cells = <1>;
> > > +                       #size-cells = <0>;
> > > +                       compatible = "aspeed,ast2500-spi";
> > > +                       status = "disabled";
> > 
> > As this is disabled it has no affect. You can remove the entire host_pnor
> > node.
> > 
> 
> Ok. I will remove it.
> But should I have somewhere the below definitions:
>                        pinctrl-0 = <&pinctrl_spi2ck_default
>                                     &pinctrl_spi2cs0_default
>                                     &pinctrl_spi2miso_default
>                                     &pinctrl_spi2mosi_default>;

If you're removing the node you should also remove the pinctrl
properties. The pinctrl settings are not honoured if the device won't
be probed (i.e. if status is disabled).

> 
> 
> > > +                       pinctrl-names = "default";
> > > +                       pinctrl-0 = <&pinctrl_spi2ck_default
> > > +                                    &pinctrl_spi2cs0_default
> > > +                                    &pinctrl_spi2miso_default
> > > +                                    &pinctrl_spi2mosi_default>;
> > > +
> > > +                       host_flash {
> > > +                               reg = < 0 >;
> > > +                               compatible = "jedec,spi-nor";
> > > +                               label = "host_flash";
> > > +                               #address-cells = < 1 >;
> > > +                               #size-cells = < 1 >;
> > > +                       };
> > > +               };
> > > +       };
> > > +};
> > > +
> > > +&uart5 {
> > > +       status = "okay";
> > > +};
> > > +
> > > +&uart1 {
> > > +       status = "okay";
> > 
> > You need to request the pins from pinmux. If you'e got all of the
> > RS-232 lines connected, that will look like this:
> > 
> >         pinctrl-names = "default";
> >         pinctrl-0 = <&pinctrl_txd1_default
> >                         &pinctrl_rxd1_default
> >                         &pinctrl_nrts1_default
> >                         &pinctrl_ndtr1_default
> >                         &pinctrl_ndsr1_default
> >                         &pinctrl_ncts1_default
> >                         &pinctrl_ndcd1_default
> >                         &pinctrl_nri1_default>;
> > 
> > You may just have the tx and rx lines connected, in which case it would look
> > like this:
> > 
> >         pinctrl-names = "default";
> >         pinctrl-0 = <&pinctrl_txd1_default
> >                         &pinctrl_rxd1_default>;
> > 
> > You will need to check your schematic to work that out.
> > 
> > > +};
> > > +
> > > +&mac0 {
> > > +       status = "okay";
> > > +       use-ncsi;
> > > +};
> > > +
> > > +&i2c0 {
> > > +       status = "okay";
> > > +};
> > > +
> > > +&i2c1 {
> > > +       status = "okay";
> > > +};
> > > +
> > > +&i2c2 {
> > > +       status = "okay";
> > > +};
> > > +
> > > +&i2c3 {
> > > +       status = "okay";
> > > +};
> > > +
> > > +&i2c4 {
> > > +       status = "okay";
> > > +};
> > 
> > 
> > I assume you're enabling these i2c buses so you can use them from
> > userspace?
> > 
> 
> On device i2c4 we have 4 CPLDs, and related kernel driver, which we locate in driver/mfd/.
> This driver handles LED, chassis interrupts, selects, exposes through sysfs reset control, reset cause and general info.
> It also handles hotplug events, like PSU/FAN/power cable removal/insertion.
> 
> For example, FAN EEPROM are located at virtual buses, created by pca9548:
> > 	i2cswitch at 71 {
> > 		compatible = "nxp,pca9548";
> > 		#address-cells = <1>;
> > 		#size-cells = <0>;
> > 		reg = <0x71>;
> 	};
> 
> The physical i2c buses which are not set with  status "ok" are skipped and the numbering of virtual buses will be started from the next available number.
> We wants to have them at constant position (in the below fragment this number is specified in bus filed) to have FAN (same for PSU, cables) at same position in sysfs for the different systems.
> And we didn't find how enforce  pca9548 to start virtual buses from the desirable number (14 in our case) through dts.

For i2c this can be handled by the aliases node in the devicetree, and
the behaviour is managed by i2c-core. You can set up aliases for all of
the buses and only set 'status = "okay";' for nodes you need. I've
linked the core code at [1].

[1] https://github.com/openbmc/linux/blob/dev-4.10/drivers/i2c/i2c-core.c#L2078

Cheers,

Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20170530/9a2b00bf/attachment.sig>


More information about the openbmc mailing list