Hi Fabio, > Subject: Re: [PATCH 21/21] imx93_evk: Enable M.2 VPCIe_3V3 and > deassert SD3_nRST > > Hi Peng, > > On Mon, Sep 16, 2024 at 11:31 PM Peng Fan (OSS) > <peng....@oss.nxp.com> wrote: > > > + /* Enable EXT1_PWREN for PCIE_3.3V */ > > + ret = dm_gpio_lookup_name("gpio@22_13", &desc); > > + if (ret) > > + return; > > + > > + ret = dm_gpio_request(&desc, "EXT1_PWREN"); > > + if (ret) > > + return; > > + > > + dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT); > > + dm_gpio_set_value(&desc, 1); > > + > > + /* Deassert SD3_nRST */ > > + ret = dm_gpio_lookup_name("gpio@22_12", &desc); > > + if (ret) > > + return; > > + > > + ret = dm_gpio_request(&desc, "SD3_nRST"); > > + if (ret) > > + return; > > + > > + dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT); > > + dm_gpio_set_value(&desc, 1); > > Why do we need all this board code? This should be properly described > in the devicetree.
I just cherry-picked the patches from imx v2024.04, I agree your point that the board code should be dropped. > > How does Linux deal with it? The linux changes still in downstream as below: /* * For this spi-nor on M.2 card, need first enable the VPCIe_3.3v. * Note, VPCIe_3.3v need about 1.74ms to change from 0v to 3.3v. * U-boot already enable VPCIe_3.3v, so in linux, can ignore this * 1.7ms, if u-boot do not eanble VPCIe_3.3v first, then need to * take care of the 1.74ms delay, better to build the flexspi driver * as module in driver to avoid spi-nor probe fail. */ pinctrl-assert-gpios = <&pcal6524 13 GPIO_ACTIVE_HIGH>, /* enable VPCIe_3v3 */ <&pcal6524 20 GPIO_ACTIVE_HIGH>, /* enable SPI-NOR VCC 1.8v */ <&pcal6524 12 GPIO_ACTIVE_HIGH>; /* put SPI-NOR RST pin to 1.8v */ To use device tree, need use reset-gpios property I think. Regards, Peng.