From owner-svn-src-all@FreeBSD.ORG Tue Mar 27 15:43:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56EB61065676; Tue, 27 Mar 2012 15:43:33 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 254A98FC2A; Tue, 27 Mar 2012 15:43:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2RFhXi8092970; Tue, 27 Mar 2012 15:43:33 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2RFhW5r092967; Tue, 27 Mar 2012 15:43:32 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201203271543.q2RFhW5r092967@svn.freebsd.org> From: "Jayachandran C." Date: Tue, 27 Mar 2012 15:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233564 - in head/sys/mips: conf nlm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Mar 2012 15:43:33 -0000 Author: jchandra Date: Tue Mar 27 15:43:32 2012 New Revision: 233564 URL: http://svn.freebsd.org/changeset/base/233564 Log: Resource allocation for XLP SoC SDHCI slots The on-chip SD slots do not have PCI BARs corresponding to them, so this has to be handled in the custom SoC memory allocation. Provide memory resource for rids corresponding to BAR 0 and 1 in the custom allocation code. Modified: head/sys/mips/conf/std.XLP head/sys/mips/nlm/xlp_pci.c Modified: head/sys/mips/conf/std.XLP ============================================================================== --- head/sys/mips/conf/std.XLP Tue Mar 27 15:39:55 2012 (r233563) +++ head/sys/mips/conf/std.XLP Tue Mar 27 15:43:32 2012 (r233564) @@ -110,3 +110,8 @@ options GEOM_ELI # NOR device cfi device cfid + +# MMC/SD +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card +device sdhci # Generic PCI SD Host Controller Modified: head/sys/mips/nlm/xlp_pci.c ============================================================================== --- head/sys/mips/nlm/xlp_pci.c Tue Mar 27 15:39:55 2012 (r233563) +++ head/sys/mips/nlm/xlp_pci.c Tue Mar 27 15:43:32 2012 (r233564) @@ -165,8 +165,22 @@ xlp_pci_alloc_resource(device_t bus, dev /* no emulation for IO ports */ if (type == SYS_RES_IOPORT) return (NULL); + start = xlp_devinfo->mem_res_start; count = XLP_PCIE_CFG_SIZE - XLP_IO_PCI_HDRSZ; + + /* MMC needs to 2 slots with rids 16 and 20 and a + * fixup for size */ + if (pci_get_device(child) == PCI_DEVICE_ID_NLM_MMC) { + count = 0x100; + if (*rid == 16) + ; /* first slot already setup */ + else if (*rid == 20) + start += 0x100; /* second slot */ + else + return (NULL); + } + end = start + count - 1; r = BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, rid, start, end, count, flags); @@ -254,6 +268,8 @@ xlp_add_soc_child(device_t pcib, device_ xlp_dinfo = (struct xlp_devinfo *)dinfo; xlp_dinfo->irq = irq; xlp_dinfo->flags = flags; + + /* memory resource from ecfg space, if MEM_RES_EMUL is set */ if ((flags & MEM_RES_EMUL) != 0) xlp_dinfo->mem_res_start = XLP_DEFAULT_IO_BASE + devoffset + XLP_IO_PCI_HDRSZ;