From owner-svn-src-all@FreeBSD.ORG Thu Apr 16 11:20:19 2009 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 58C6C106566B; Thu, 16 Apr 2009 11:20:19 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DE378FC1D; Thu, 16 Apr 2009 11:20:19 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GBKJQE078717; Thu, 16 Apr 2009 11:20:19 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GBKIfn078711; Thu, 16 Apr 2009 11:20:18 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200904161120.n3GBKIfn078711@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 16 Apr 2009 11:20:18 +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: r191140 - in head/sys: arm/mv dev/mge 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: Thu, 16 Apr 2009 11:20:20 -0000 Author: raj Date: Thu Apr 16 11:20:18 2009 New Revision: 191140 URL: http://svn.freebsd.org/changeset/base/191140 Log: Adjust Marvell Discovery (MV78xxx) support to recognize newest chip revisions, handle Z0 revision (early silicon) explicitly due to its quirks. Obtained from: Marvell, Semihalf Modified: head/sys/arm/mv/common.c head/sys/arm/mv/gpio.c head/sys/arm/mv/ic.c head/sys/arm/mv/mv_pci.c head/sys/arm/mv/mvreg.h head/sys/dev/mge/if_mge.c Modified: head/sys/arm/mv/common.c ============================================================================== --- head/sys/arm/mv/common.c Thu Apr 16 11:09:59 2009 (r191139) +++ head/sys/arm/mv/common.c Thu Apr 16 11:20:18 2009 (r191140) @@ -91,7 +91,8 @@ cpu_extra_feat(void) uint32_t ef = 0; soc_id(&dev, &rev); - if (dev == MV_DEV_88F6281 || dev == MV_DEV_MV78100) + if (dev == MV_DEV_88F6281 || dev == MV_DEV_MV78100_Z0 || + dev == MV_DEV_MV78100) __asm __volatile("mrc p15, 1, %0, c15, c1, 0" : "=r" (ef)); else if (dev == MV_DEV_88F5182 || dev == MV_DEV_88F5281) __asm __volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (ef)); @@ -166,6 +167,9 @@ soc_identify(void) else if (r == 2) rev = "A0"; break; + case MV_DEV_MV78100_Z0: + dev = "Marvell MV78100 Z0"; + break; case MV_DEV_MV78100: dev = "Marvell MV78100"; break; @@ -199,15 +203,16 @@ soc_decode_win(void) decode_win_cpu_setup(); decode_win_usb_setup(); decode_win_eth_setup(MV_ETH0_BASE); - if (dev == MV_DEV_MV78100) + if (dev == MV_DEV_MV78100 || dev == MV_DEV_MV78100_Z0) decode_win_eth_setup(MV_ETH1_BASE); - if (dev == MV_DEV_88F6281 || dev == MV_DEV_MV78100) + if (dev == MV_DEV_88F6281 || dev == MV_DEV_MV78100 || + dev == MV_DEV_MV78100_Z0) decode_win_cesa_setup(); decode_win_idma_setup(); decode_win_xor_setup(); - if (dev == MV_DEV_MV78100) { + if (dev == MV_DEV_MV78100 || dev == MV_DEV_MV78100_Z0) { decode_win_pcie_setup(MV_PCIE00_BASE); decode_win_pcie_setup(MV_PCIE01_BASE); decode_win_pcie_setup(MV_PCIE02_BASE); @@ -360,7 +365,8 @@ win_cpu_can_remap(int i) if ((dev == MV_DEV_88F5182 && i < 2) || (dev == MV_DEV_88F5281 && i < 4) || (dev == MV_DEV_88F6281 && i < 4) || - (dev == MV_DEV_MV78100 && i < 8)) + (dev == MV_DEV_MV78100 && i < 8) || + (dev == MV_DEV_MV78100_Z0 && i < 8)) return (1); return (0); @@ -590,7 +596,7 @@ usb_max_ports(void) uint32_t dev, rev; soc_id(&dev, &rev); - return (dev == MV_DEV_MV78100 ? 3 : 1); + return ((dev == MV_DEV_MV78100 || dev == MV_DEV_MV78100_Z0) ? 3 : 1); } static void @@ -1109,14 +1115,18 @@ win_xor_can_remap(int i) return (0); } -static __inline int +static int xor_max_eng(void) { uint32_t dev, rev; soc_id(&dev, &rev); - return ((dev == MV_DEV_88F6281) ? 2 : - (dev == MV_DEV_MV78100) ? 1 : 0); + if (dev == MV_DEV_88F6281) + return (2); + else if ((dev == MV_DEV_MV78100) || (dev == MV_DEV_MV78100_Z0)) + return (1); + else + return (0); } static void Modified: head/sys/arm/mv/gpio.c ============================================================================== --- head/sys/arm/mv/gpio.c Thu Apr 16 11:09:59 2009 (r191139) +++ head/sys/arm/mv/gpio.c Thu Apr 16 11:20:18 2009 (r191140) @@ -123,12 +123,13 @@ mv_gpio_attach(device_t dev) return (ENXIO); mv_gpio_softc = sc; - /* Get board id and revision */ + /* Get chip id and revision */ soc_id(&dev_id, &rev_id); if (dev_id == MV_DEV_88F5182 || dev_id == MV_DEV_88F5281 || - dev_id == MV_DEV_MV78100) { + dev_id == MV_DEV_MV78100 || + dev_id == MV_DEV_MV78100_Z0 ) { sc->pin_num = 32; sc->irq_num = 4; sc->use_high = 0; @@ -139,7 +140,7 @@ mv_gpio_attach(device_t dev) sc->use_high = 1; } else { - device_printf(dev, "unknown board id=0x%x\n", dev_id); + device_printf(dev, "unknown chip id=0x%x\n", dev_id); return (ENXIO); } Modified: head/sys/arm/mv/ic.c ============================================================================== --- head/sys/arm/mv/ic.c Thu Apr 16 11:09:59 2009 (r191139) +++ head/sys/arm/mv/ic.c Thu Apr 16 11:20:18 2009 (r191140) @@ -98,10 +98,11 @@ mv_ic_attach(device_t dev) sc->ic_high_regs = 0; sc->ic_error_regs = 0; - if (dev_id == MV_DEV_88F6281 || dev_id == MV_DEV_MV78100) + if (dev_id == MV_DEV_88F6281 || dev_id == MV_DEV_MV78100 || + dev_id == MV_DEV_MV78100_Z0) sc->ic_high_regs = 1; - if (dev_id == MV_DEV_MV78100) + if (dev_id == MV_DEV_MV78100 || dev_id == MV_DEV_MV78100_Z0) sc->ic_error_regs = 1; error = bus_alloc_resources(dev, mv_ic_spec, sc->ic_res); Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Thu Apr 16 11:09:59 2009 (r191139) +++ head/sys/arm/mv/mv_pci.c Thu Apr 16 11:20:18 2009 (r191140) @@ -459,8 +459,18 @@ pcib_mbus_probe(device_t self) id = "88F6281"; break; case 0x6381: + id = "MV78100 Z0"; + break; + case 0x7810: id = "MV78100"; break; + case 0x7820: + /* + * According to documentation ID 0x7820 is assigned to MV78200. + * However some MV78100 chips also use it. + */ + id = "MV78100/MV78200"; + break; default: device_printf(self, "unknown Marvell PCI bridge: %x\n", val); goto out; Modified: head/sys/arm/mv/mvreg.h ============================================================================== --- head/sys/arm/mv/mvreg.h Thu Apr 16 11:09:59 2009 (r191139) +++ head/sys/arm/mv/mvreg.h Thu Apr 16 11:20:18 2009 (r191140) @@ -471,11 +471,12 @@ /* * Chip ID */ -#define MV_DEV_88F5181 0x5181 -#define MV_DEV_88F5182 0x5182 -#define MV_DEV_88F5281 0x5281 -#define MV_DEV_88F6281 0x6281 -#define MV_DEV_MV78100 0x6381 +#define MV_DEV_88F5181 0x5181 +#define MV_DEV_88F5182 0x5182 +#define MV_DEV_88F5281 0x5281 +#define MV_DEV_88F6281 0x6281 +#define MV_DEV_MV78100_Z0 0x6381 +#define MV_DEV_MV78100 0x7810 /* * Decode windows definitions and macros Modified: head/sys/dev/mge/if_mge.c ============================================================================== --- head/sys/dev/mge/if_mge.c Thu Apr 16 11:09:59 2009 (r191139) +++ head/sys/dev/mge/if_mge.c Thu Apr 16 11:20:18 2009 (r191140) @@ -239,7 +239,8 @@ mge_ver_params(struct mge_softc *sc) uint32_t d, r; soc_id(&d, &r); - if (d == MV_DEV_88F6281 || d == MV_DEV_MV78100) { + if (d == MV_DEV_88F6281 || d == MV_DEV_MV78100 || + d == MV_DEV_MV78100_Z0) { sc->mge_ver = 2; sc->mge_mtu = 0x4e8; sc->mge_tfut_ipg_max = 0xFFFF;