From: Tom Rini Date: Tue, 29 Sep 2020 13:55:42 -0400 Subject: [PATCH v3 1/3] net: cortina_ni: Add eth support for Cortina Access CAxxxx SoCs In-Reply-To: <1600909154-1713-1-git-send-email-alex.nemirovsky@cortina-access.com> References: <1600909154-1713-1-git-send-email-alex.nemirovsky@cortina-access.com> Message-ID: <20200929175542.GK14816@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Sep 23, 2020 at 05:59:12PM -0700, Alex Nemirovsky wrote: > From: Abbie Chang > > Add Cortina Access Ethernet device driver for CAxxxx SoCs. > This driver supports both legacy and DM_ETH network models. > > Signed-off-by: Aaron Tseng > Signed-off-by: Alex Nemirovsky > Signed-off-by: Abbie Chang > > CC: Joe Hershberger > CC: Abbie Chang > CC: Tom Rini [snip] Again, please give the whole driver a read and compare it with other network drivers that've been most recently added. I question things like: > +static u32 *rdwrptr_adv_one(u32 *x, unsigned long base, unsigned long max) > +{ > + if (x + 1 >= (u32 *)max) > + return (u32 *)base; > + else > + return (x + 1); > +} [snip] > +static u32 REG_TO_U32(void *reg) > +{ > + return *(u32 *)reg; > +} [snip] > +int ca_miiphy_read(const char *devname, > + unsigned char addr, > + unsigned char reg, > + unsigned short *value) > +{ > + return ca_mdio_read(addr, reg, value); > +} > + > +int ca_miiphy_write(const char *devname, > + unsigned char addr, > + unsigned char reg, > + unsigned short value) > +{ > + return ca_mdio_write(addr, reg, value); > +} And lots of other simple looking wrappers. [snip] > +static void ca_ni_setup_mac_addr(void) > +{ > + unsigned char mac[6]; > + > + struct NI_HV_GLB_MAC_ADDR_CFG0_t mac_addr_cfg0; > + struct NI_HV_GLB_MAC_ADDR_CFG1_t mac_addr_cfg1; > + struct NI_HV_PT_PORT_STATIC_CFG_t port_static_cfg; > + struct NI_HV_XRAM_CPUXRAM_CFG_t cpuxram_cfg; > + struct cortina_ni_priv *priv = dev_get_priv(curr_dev); While checkpatch didn't complain, can you please fix the driver to use consistent spacing? I feel like I asked before about Linux upstreaming of these drivers and the answer was that it was planned for later, is that right? -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: