Re: svn commit: r365054 - in head/sys: conf dev/sdhci
Hi Justin, Thanks for your input. Please see inline. wt., 1 wrz 2020 o 23:30 Justin Hibbits napisał(a): > > Sep 1, 2020 11:17:35 Marcin Wojtas : > > > Author: mw > > Date: Tue Sep 1 16:17:21 2020 > > New Revision: 365054 > > URL: https://svnweb.freebsd.org/changeset/base/365054 > > > > Log: > > Introduce the SDHCI driver for NXP QorIQ Layerscape SoCs > > > > Implement support for an eSDHC controller found in NXP QorIQ Layerscape > > SoCs. > > > > This driver has been tested with NXP LS1046A and LX2160A (Honeycomb board), > > which is incompatible with the existing sdhci_fsl driver (aiming at older > > chips from this family). As such, it is not intended as replacement for > > the old driver, but rather serves as an improved alternative for SoCs that > > support it. > > It comes with support for both PIO and Single DMA modes and samples the > > clock from the extres clk API. > > How is it incompatible? > > > > > Submitted by: Artur Rojek > > Reviewed by: manu, mmel, kibab > > Obtained from: Semihalf > > Sponsored by: Alstom Group > > Differential Revision: https://reviews.freebsd.org/D26153 > > > > Added: > > head/sys/dev/sdhci/sdhci_fsl_fdt.c (contents, props changed) > > The name choice here is odd, given there is already fsl_sdhci.c > > > Modified: > > head/sys/conf/files > > > > Modified: head/sys/conf/files > > == > > --- head/sys/conf/files Tue Sep 1 16:13:09 2020 (r365053) > > +++ head/sys/conf/files Tue Sep 1 16:17:21 2020 (r365054) > > @@ -3058,6 +3058,7 @@ dev/scc/scc_dev_z8530.c optional scc > > dev/sdhci/sdhci.coptional sdhci > > dev/sdhci/sdhci_fdt.coptional sdhci fdt > > dev/sdhci/sdhci_fdt_gpio.c optional sdhci fdt gpio > > +dev/sdhci/sdhci_fsl_fdt.c optional sdhci fdt gpio > > dev/sdhci/sdhci_if.m optional sdhci > > dev/sdhci/sdhci_acpi.c optional sdhci acpi > > dev/sdhci/sdhci_pci.coptional sdhci pci > > > > Added: head/sys/dev/sdhci/sdhci_fsl_fdt.c > > == > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/dev/sdhci/sdhci_fsl_fdt.c Tue Sep 1 16:17:21 2020 (r365054) > > @@ -0,0 +1,680 @@ > > +/*- > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > > + * > > + * Copyright (c) 2020 Alstom Group. > > + * Copyright (c) 2020 Semihalf. > > + * > > + * Redistribution and use in source and binary forms, with or without > > + * modification, are permitted provided that the following conditions > > + * are met: > > + * 1. Redistributions of source code must retain the above copyright > > + *notice, this list of conditions and the following disclaimer. > > + * 2. Redistributions in binary form must reproduce the above copyright > > + *notice, this list of conditions and the following disclaimer in the > > + *documentation and/or other materials provided with the distribution. > > + * > > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > > PURPOSE > > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > > CONSEQUENTIAL > > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > > STRICT > > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > > WAY > > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > > + * SUCH DAMAGE. > > + */ > > + > > +/* eSDHC controller driver for NXP QorIQ Layerscape SoCs. */ > > + > > +#include > > +__FBSDID("$FreeBSD$"); > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include "mmcbr_if.h" > > +#include "sdhci_if.h" > > + > > +#define RD4 (sc->read) > > +#define WR4 (sc->write) > > + > > +#define SDHCI_FSL_PRES_STATE0x24 > > +#define SDHCI_FSL_PRES_SDSTB(1 << 3) > > +#define SDHCI_FSL_PRES_COMPAT_MASK 0x000f0f07 > > + > > +#define SDHCI_FSL_PROT_CTRL 0x28 > > +#define SDHCI_FSL_PROT_CTRL_WIDTH_1BIT (0 << 1) > > +#define SDHCI_FSL_PROT_CTRL_WIDTH_4BIT (1 << 1) > > +#define SDHCI_FSL_PROT_CTRL_WIDTH_8BIT (2 << 1) > > +#define SDHCI_FSL_PROT_CTRL_WIDTH_MASK (3 << 1) > > +#define SDHCI_FSL_PROT_CTRL_BYTE_SWAP (0 << 4) > > +#define SDHCI_FSL_PROT_CTRL_BYTE_NATIVE (2 << 4) > > +#define SDHCI_FSL_PROT_CTRL_BYTE_MASK (3 << 4) > > +#define SDHCI_FSL_PROT_CTRL_DMA_MASK (3 << 8) > > + > > +#define
Re: svn commit: r365054 - in head/sys: conf dev/sdhci
Hi Hans, śr., 2 wrz 2020 o 12:47 Hans Petter Selasky napisał(a): > > Does this patch fix the problem: > > Index: sys/conf/files > === > --- sys/conf/files (revision 365234) > +++ sys/conf/files (working copy) > @@ -3058,7 +3058,7 @@ > dev/sdhci/sdhci.c optional sdhci > dev/sdhci/sdhci_fdt.c optional sdhci fdt > dev/sdhci/sdhci_fdt_gpio.coptional sdhci fdt gpio > -dev/sdhci/sdhci_fsl_fdt.c optional sdhci fdt gpio > +dev/sdhci/sdhci_fsl_fdt.c optional ext_resources sdhci fdt gpio > dev/sdhci/sdhci_if.m optional sdhci > dev/sdhci/sdhci_acpi.coptional sdhci acpi > dev/sdhci/sdhci_pci.c optional sdhci pci > Yes, it does - I found out that you already submitted a patch during the svn commit (thank you). I only added extra option requested by Andrew (SOC_NXP_LS) - I'll wait with this until resolving discussion with Justin. Best regards, Marcin ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r365054 - in head/sys: conf dev/sdhci
Does this patch fix the problem: Index: sys/conf/files === --- sys/conf/files (revision 365234) +++ sys/conf/files (working copy) @@ -3058,7 +3058,7 @@ dev/sdhci/sdhci.c optional sdhci dev/sdhci/sdhci_fdt.c optional sdhci fdt dev/sdhci/sdhci_fdt_gpio.c optional sdhci fdt gpio -dev/sdhci/sdhci_fsl_fdt.c optional sdhci fdt gpio +dev/sdhci/sdhci_fsl_fdt.c optional ext_resources sdhci fdt gpio dev/sdhci/sdhci_if.m optional sdhci dev/sdhci/sdhci_acpi.c optional sdhci acpi dev/sdhci/sdhci_pci.c optional sdhci pci --HPS ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r365054 - in head/sys: conf dev/sdhci
wt., 1 wrz 2020 o 22:37 Mateusz Guzik napisał(a): > This commit breaks numerous kernels, e.g. _.arm.RPI-B: > > In file included from /usr/src/sys/dev/sdhci/sdhci_fsl_fdt.c:45: > /usr/src/sys/dev/extres/clk/clk.h:37:10: fatal error: 'clknode_if.h' > file not found > #include "clknode_if.h" > > Unfortunately yes, fixing it. > On 9/1/20, Marcin Wojtas wrote: > > Author: mw > > Date: Tue Sep 1 16:17:21 2020 > > New Revision: 365054 > > URL: https://svnweb.freebsd.org/changeset/base/365054 > > > > Log: > > Introduce the SDHCI driver for NXP QorIQ Layerscape SoCs > > > > Implement support for an eSDHC controller found in NXP QorIQ Layerscape > > SoCs. > > > > This driver has been tested with NXP LS1046A and LX2160A (Honeycomb > > board), > > which is incompatible with the existing sdhci_fsl driver (aiming at > older > > chips from this family). As such, it is not intended as replacement for > > the old driver, but rather serves as an improved alternative for SoCs > > that > > support it. > > It comes with support for both PIO and Single DMA modes and samples the > > clock from the extres clk API. > > > > Submitted by: Artur Rojek > > Reviewed by: manu, mmel, kibab > > Obtained from: Semihalf > > Sponsored by: Alstom Group > > Differential Revision: https://reviews.freebsd.org/D26153 > > > > Added: > > head/sys/dev/sdhci/sdhci_fsl_fdt.c (contents, props changed) > > Modified: > > head/sys/conf/files > > > > Modified: head/sys/conf/files > > > == > > --- head/sys/conf/files Tue Sep 1 16:13:09 2020(r365053) > > +++ head/sys/conf/files Tue Sep 1 16:17:21 2020(r365054) > > @@ -3058,6 +3058,7 @@ dev/scc/scc_dev_z8530.c optional scc > > dev/sdhci/sdhci.coptional sdhci > > dev/sdhci/sdhci_fdt.coptional sdhci fdt > > dev/sdhci/sdhci_fdt_gpio.c optional sdhci fdt gpio > > +dev/sdhci/sdhci_fsl_fdt.coptional sdhci fdt gpio > > dev/sdhci/sdhci_if.m optional sdhci > > dev/sdhci/sdhci_acpi.c optional sdhci acpi > > dev/sdhci/sdhci_pci.coptional sdhci pci > > > > Added: head/sys/dev/sdhci/sdhci_fsl_fdt.c > > > == > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/dev/sdhci/sdhci_fsl_fdt.cTue Sep 1 16:17:21 2020 > (r365054) > > @@ -0,0 +1,680 @@ > > +/*- > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > > + * > > + * Copyright (c) 2020 Alstom Group. > > + * Copyright (c) 2020 Semihalf. > > + * > > + * Redistribution and use in source and binary forms, with or without > > + * modification, are permitted provided that the following conditions > > + * are met: > > + * 1. Redistributions of source code must retain the above copyright > > + *notice, this list of conditions and the following disclaimer. > > + * 2. Redistributions in binary form must reproduce the above copyright > > + *notice, this list of conditions and the following disclaimer in > the > > + *documentation and/or other materials provided with the > distribution. > > + * > > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' > AND > > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > > PURPOSE > > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE > LIABLE > > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > > CONSEQUENTIAL > > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE > GOODS > > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > > STRICT > > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > > WAY > > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY > OF > > + * SUCH DAMAGE. > > + */ > > + > > +/* eSDHC controller driver for NXP QorIQ Layerscape SoCs. */ > > + > > +#include > > +__FBSDID("$FreeBSD$"); > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include "mmcbr_if.h" > > +#include "sdhci_if.h" > > + > > +#define RD4 (sc->read) > > +#define WR4 (sc->write) > > + > > +#define SDHCI_FSL_PRES_STATE0x24 > > +#define SDHCI_FSL_PRES_SDSTB(1 << 3) > > +#define SDHCI_FSL_PRES_COMPAT_MASK 0x000f0f07 > > + > > +#define SDHCI_FSL_PROT_CTRL 0x28 > > +#define SDHCI_FSL_PROT_CTRL_WIDTH_1BIT (0 << 1) > > +#define SDHCI_FSL_PROT_CTRL_WIDTH_4BIT (1 << 1) > > +#define
Re: svn commit: r365054 - in head/sys: conf dev/sdhci
Sep 1, 2020 11:17:35 Marcin Wojtas : > Author: mw > Date: Tue Sep 1 16:17:21 2020 > New Revision: 365054 > URL: https://svnweb.freebsd.org/changeset/base/365054 > > Log: > Introduce the SDHCI driver for NXP QorIQ Layerscape SoCs > > Implement support for an eSDHC controller found in NXP QorIQ Layerscape SoCs. > > This driver has been tested with NXP LS1046A and LX2160A (Honeycomb board), > which is incompatible with the existing sdhci_fsl driver (aiming at older > chips from this family). As such, it is not intended as replacement for > the old driver, but rather serves as an improved alternative for SoCs that > support it. > It comes with support for both PIO and Single DMA modes and samples the > clock from the extres clk API. How is it incompatible? > > Submitted by: Artur Rojek > Reviewed by: manu, mmel, kibab > Obtained from: Semihalf > Sponsored by: Alstom Group > Differential Revision: https://reviews.freebsd.org/D26153 > > Added: > head/sys/dev/sdhci/sdhci_fsl_fdt.c (contents, props changed) The name choice here is odd, given there is already fsl_sdhci.c > Modified: > head/sys/conf/files > > Modified: head/sys/conf/files > == > --- head/sys/conf/files Tue Sep 1 16:13:09 2020 (r365053) > +++ head/sys/conf/files Tue Sep 1 16:17:21 2020 (r365054) > @@ -3058,6 +3058,7 @@ dev/scc/scc_dev_z8530.c optional scc > dev/sdhci/sdhci.c optional sdhci > dev/sdhci/sdhci_fdt.c optional sdhci fdt > dev/sdhci/sdhci_fdt_gpio.c optional sdhci fdt gpio > +dev/sdhci/sdhci_fsl_fdt.c optional sdhci fdt gpio > dev/sdhci/sdhci_if.m optional sdhci > dev/sdhci/sdhci_acpi.c optional sdhci acpi > dev/sdhci/sdhci_pci.c optional sdhci pci > > Added: head/sys/dev/sdhci/sdhci_fsl_fdt.c > == > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/sdhci/sdhci_fsl_fdt.c Tue Sep 1 16:17:21 2020 (r365054) > @@ -0,0 +1,680 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2020 Alstom Group. > + * Copyright (c) 2020 Semihalf. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +/* eSDHC controller driver for NXP QorIQ Layerscape SoCs. */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "mmcbr_if.h" > +#include "sdhci_if.h" > + > +#define RD4 (sc->read) > +#define WR4 (sc->write) > + > +#define SDHCI_FSL_PRES_STATE 0x24 > +#define SDHCI_FSL_PRES_SDSTB (1 << 3) > +#define SDHCI_FSL_PRES_COMPAT_MASK 0x000f0f07 > + > +#define SDHCI_FSL_PROT_CTRL 0x28 > +#define SDHCI_FSL_PROT_CTRL_WIDTH_1BIT (0 << 1) > +#define SDHCI_FSL_PROT_CTRL_WIDTH_4BIT (1 << 1) > +#define SDHCI_FSL_PROT_CTRL_WIDTH_8BIT (2 << 1) > +#define SDHCI_FSL_PROT_CTRL_WIDTH_MASK (3 << 1) > +#define SDHCI_FSL_PROT_CTRL_BYTE_SWAP (0 << 4) > +#define SDHCI_FSL_PROT_CTRL_BYTE_NATIVE (2 << 4) > +#define SDHCI_FSL_PROT_CTRL_BYTE_MASK (3 << 4) > +#define SDHCI_FSL_PROT_CTRL_DMA_MASK (3 << 8) > + > +#define SDHCI_FSL_SYS_CTRL 0x2c > +#define SDHCI_FSL_CLK_IPGEN (1 << 0) > +#define SDHCI_FSL_CLK_SDCLKEN (1 << 3) > +#define SDHCI_FSL_CLK_DIVIDER_MASK 0x00f0 > +#define SDHCI_FSL_CLK_DIVIDER_SHIFT 4 > +#define SDHCI_FSL_CLK_PRESCALE_MASK 0xff00 > +#define SDHCI_FSL_CLK_PRESCALE_SHIFT 8 > + > +#define SDHCI_FSL_WTMK_LVL 0x44 > +#define SDHCI_FSL_WTMK_RD_512B (0 << 0) >
Re: svn commit: r365054 - in head/sys: conf dev/sdhci
This commit breaks numerous kernels, e.g. _.arm.RPI-B: In file included from /usr/src/sys/dev/sdhci/sdhci_fsl_fdt.c:45: /usr/src/sys/dev/extres/clk/clk.h:37:10: fatal error: 'clknode_if.h' file not found #include "clknode_if.h" On 9/1/20, Marcin Wojtas wrote: > Author: mw > Date: Tue Sep 1 16:17:21 2020 > New Revision: 365054 > URL: https://svnweb.freebsd.org/changeset/base/365054 > > Log: > Introduce the SDHCI driver for NXP QorIQ Layerscape SoCs > > Implement support for an eSDHC controller found in NXP QorIQ Layerscape > SoCs. > > This driver has been tested with NXP LS1046A and LX2160A (Honeycomb > board), > which is incompatible with the existing sdhci_fsl driver (aiming at older > chips from this family). As such, it is not intended as replacement for > the old driver, but rather serves as an improved alternative for SoCs > that > support it. > It comes with support for both PIO and Single DMA modes and samples the > clock from the extres clk API. > > Submitted by: Artur Rojek > Reviewed by: manu, mmel, kibab > Obtained from: Semihalf > Sponsored by: Alstom Group > Differential Revision: https://reviews.freebsd.org/D26153 > > Added: > head/sys/dev/sdhci/sdhci_fsl_fdt.c (contents, props changed) > Modified: > head/sys/conf/files > > Modified: head/sys/conf/files > == > --- head/sys/conf/files Tue Sep 1 16:13:09 2020(r365053) > +++ head/sys/conf/files Tue Sep 1 16:17:21 2020(r365054) > @@ -3058,6 +3058,7 @@ dev/scc/scc_dev_z8530.c optional scc > dev/sdhci/sdhci.coptional sdhci > dev/sdhci/sdhci_fdt.coptional sdhci fdt > dev/sdhci/sdhci_fdt_gpio.c optional sdhci fdt gpio > +dev/sdhci/sdhci_fsl_fdt.coptional sdhci fdt gpio > dev/sdhci/sdhci_if.m optional sdhci > dev/sdhci/sdhci_acpi.c optional sdhci acpi > dev/sdhci/sdhci_pci.coptional sdhci pci > > Added: head/sys/dev/sdhci/sdhci_fsl_fdt.c > == > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/sdhci/sdhci_fsl_fdt.cTue Sep 1 16:17:21 2020 > (r365054) > @@ -0,0 +1,680 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2020 Alstom Group. > + * Copyright (c) 2020 Semihalf. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + *notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + *notice, this list of conditions and the following disclaimer in the > + *documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +/* eSDHC controller driver for NXP QorIQ Layerscape SoCs. */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "mmcbr_if.h" > +#include "sdhci_if.h" > + > +#define RD4 (sc->read) > +#define WR4 (sc->write) > + > +#define SDHCI_FSL_PRES_STATE0x24 > +#define SDHCI_FSL_PRES_SDSTB(1 << 3) > +#define SDHCI_FSL_PRES_COMPAT_MASK 0x000f0f07 > + > +#define SDHCI_FSL_PROT_CTRL 0x28 > +#define SDHCI_FSL_PROT_CTRL_WIDTH_1BIT (0 << 1) > +#define SDHCI_FSL_PROT_CTRL_WIDTH_4BIT (1 << 1) > +#define SDHCI_FSL_PROT_CTRL_WIDTH_8BIT (2 << 1) > +#define SDHCI_FSL_PROT_CTRL_WIDTH_MASK (3 << 1) > +#define SDHCI_FSL_PROT_CTRL_BYTE_SWAP (0 << 4) > +#define SDHCI_FSL_PROT_CTRL_BYTE_NATIVE (2 << 4) > +#define SDHCI_FSL_PROT_CTRL_BYTE_MASK (3 << 4) > +#define SDHCI_FSL_PROT_CTRL_DMA_MASK(3 << 8) > + > +#define
Re: svn commit: r365054 - in head/sys: conf dev/sdhci
On Tue, 2020-09-01 at 17:27 +0100, Andrew Turner wrote: > > On 1 Sep 2020, at 17:17, Marcin Wojtas wrote: > > > > Author: mw > > Date: Tue Sep 1 16:17:21 2020 > > New Revision: 365054 > > URL: https://svnweb.freebsd.org/changeset/base/365054 > > > > Log: > > Introduce the SDHCI driver for NXP QorIQ Layerscape SoCs > > > > Implement support for an eSDHC controller found in NXP QorIQ > > Layerscape SoCs. > > > > This driver has been tested with NXP LS1046A and LX2160A > > (Honeycomb board), > > which is incompatible with the existing sdhci_fsl driver (aiming > > at older > > chips from this family). As such, it is not intended as > > replacement for > > the old driver, but rather serves as an improved alternative for > > SoCs that > > support it. > > It comes with support for both PIO and Single DMA modes and > > samples the > > clock from the extres clk API. > > > > Submitted by: Artur Rojek > > Reviewed by: manu, mmel, kibab > > Obtained from: Semihalf > > Sponsored by: Alstom Group > > Differential Revision: https://reviews.freebsd.org/D26153 > > > > Added: > > head/sys/dev/sdhci/sdhci_fsl_fdt.c (contents, props changed) > > Modified: > > head/sys/conf/files > > > > Modified: head/sys/conf/files > > === > > === > > --- head/sys/conf/files Tue Sep 1 16:13:09 2020(r365053) > > +++ head/sys/conf/files Tue Sep 1 16:17:21 2020(r365054) > > @@ -3058,6 +3058,7 @@ dev/scc/scc_dev_z8530.c optiona > > l scc > > dev/sdhci/sdhci.c optional sdhci > > dev/sdhci/sdhci_fdt.c optional sdhci fdt > > dev/sdhci/sdhci_fdt_gpio.c optional sdhci fdt gpio > > +dev/sdhci/sdhci_fsl_fdt.c optional sdhci fdt gpio > > This looks wrong. It should be using an NXP specific option, not > gpio. > > Andrew In addition to gpio, not instead of it (the new driver uses the fdt gpio helper stuff for card detect and write protect). -- Ian ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r365054 - in head/sys: conf dev/sdhci
> On 1 Sep 2020, at 17:17, Marcin Wojtas wrote: > > Author: mw > Date: Tue Sep 1 16:17:21 2020 > New Revision: 365054 > URL: https://svnweb.freebsd.org/changeset/base/365054 > > Log: > Introduce the SDHCI driver for NXP QorIQ Layerscape SoCs > > Implement support for an eSDHC controller found in NXP QorIQ Layerscape SoCs. > > This driver has been tested with NXP LS1046A and LX2160A (Honeycomb board), > which is incompatible with the existing sdhci_fsl driver (aiming at older > chips from this family). As such, it is not intended as replacement for > the old driver, but rather serves as an improved alternative for SoCs that > support it. > It comes with support for both PIO and Single DMA modes and samples the > clock from the extres clk API. > > Submitted by: Artur Rojek > Reviewed by: manu, mmel, kibab > Obtained from: Semihalf > Sponsored by: Alstom Group > Differential Revision: https://reviews.freebsd.org/D26153 > > Added: > head/sys/dev/sdhci/sdhci_fsl_fdt.c (contents, props changed) > Modified: > head/sys/conf/files > > Modified: head/sys/conf/files > == > --- head/sys/conf/files Tue Sep 1 16:13:09 2020(r365053) > +++ head/sys/conf/files Tue Sep 1 16:17:21 2020(r365054) > @@ -3058,6 +3058,7 @@ dev/scc/scc_dev_z8530.c optional scc > dev/sdhci/sdhci.c optional sdhci > dev/sdhci/sdhci_fdt.c optional sdhci fdt > dev/sdhci/sdhci_fdt_gpio.coptional sdhci fdt gpio > +dev/sdhci/sdhci_fsl_fdt.coptional sdhci fdt gpio This looks wrong. It should be using an NXP specific option, not gpio. Andrew ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r365054 - in head/sys: conf dev/sdhci
Author: mw Date: Tue Sep 1 16:17:21 2020 New Revision: 365054 URL: https://svnweb.freebsd.org/changeset/base/365054 Log: Introduce the SDHCI driver for NXP QorIQ Layerscape SoCs Implement support for an eSDHC controller found in NXP QorIQ Layerscape SoCs. This driver has been tested with NXP LS1046A and LX2160A (Honeycomb board), which is incompatible with the existing sdhci_fsl driver (aiming at older chips from this family). As such, it is not intended as replacement for the old driver, but rather serves as an improved alternative for SoCs that support it. It comes with support for both PIO and Single DMA modes and samples the clock from the extres clk API. Submitted by: Artur Rojek Reviewed by: manu, mmel, kibab Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D26153 Added: head/sys/dev/sdhci/sdhci_fsl_fdt.c (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files == --- head/sys/conf/files Tue Sep 1 16:13:09 2020(r365053) +++ head/sys/conf/files Tue Sep 1 16:17:21 2020(r365054) @@ -3058,6 +3058,7 @@ dev/scc/scc_dev_z8530.c optional scc dev/sdhci/sdhci.c optional sdhci dev/sdhci/sdhci_fdt.c optional sdhci fdt dev/sdhci/sdhci_fdt_gpio.c optional sdhci fdt gpio +dev/sdhci/sdhci_fsl_fdt.c optional sdhci fdt gpio dev/sdhci/sdhci_if.m optional sdhci dev/sdhci/sdhci_acpi.c optional sdhci acpi dev/sdhci/sdhci_pci.c optional sdhci pci Added: head/sys/dev/sdhci/sdhci_fsl_fdt.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sdhci/sdhci_fsl_fdt.c Tue Sep 1 16:17:21 2020 (r365054) @@ -0,0 +1,680 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Alstom Group. + * Copyright (c) 2020 Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* eSDHC controller driver for NXP QorIQ Layerscape SoCs. */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "mmcbr_if.h" +#include "sdhci_if.h" + +#defineRD4 (sc->read) +#defineWR4 (sc->write) + +#defineSDHCI_FSL_PRES_STATE0x24 +#defineSDHCI_FSL_PRES_SDSTB(1 << 3) +#defineSDHCI_FSL_PRES_COMPAT_MASK 0x000f0f07 + +#defineSDHCI_FSL_PROT_CTRL 0x28 +#defineSDHCI_FSL_PROT_CTRL_WIDTH_1BIT (0 << 1) +#defineSDHCI_FSL_PROT_CTRL_WIDTH_4BIT (1 << 1) +#defineSDHCI_FSL_PROT_CTRL_WIDTH_8BIT (2 << 1) +#defineSDHCI_FSL_PROT_CTRL_WIDTH_MASK (3 << 1) +#defineSDHCI_FSL_PROT_CTRL_BYTE_SWAP (0 << 4) +#defineSDHCI_FSL_PROT_CTRL_BYTE_NATIVE (2 << 4) +#defineSDHCI_FSL_PROT_CTRL_BYTE_MASK (3 << 4) +#defineSDHCI_FSL_PROT_CTRL_DMA_MASK(3 << 8) + +#defineSDHCI_FSL_SYS_CTRL 0x2c +#defineSDHCI_FSL_CLK_IPGEN (1 << 0) +#defineSDHCI_FSL_CLK_SDCLKEN (1 << 3) +#defineSDHCI_FSL_CLK_DIVIDER_MASK 0x00f0 +#defineSDHCI_FSL_CLK_DIVIDER_SHIFT 4 +#defineSDHCI_FSL_CLK_PRESCALE_MASK 0xff00 +#defineSDHCI_FSL_CLK_PRESCALE_SHIFT8 + +#defineSDHCI_FSL_WTMK_LVL 0x44 +#defineSDHCI_FSL_WTMK_RD_512B (0 << 0) +#define