Re: svn commit: r213346 - in head/sys: contrib/octeon-sdk mips/cavium mips/cavium/octe
On 2010-10-02, at 07:43, Juli Mallett wrote: > Author: jmallett > Date: Sat Oct 2 05:43:17 2010 > New Revision: 213346 > URL: http://svn.freebsd.org/changeset/base/213346 > > Log: > o) Allow devices to override the MDIO read and write functions presented to > the miibus attached to octe interfaces. > o) Add an SMI/MDIO interface to the MV88E61XX and use it for the switch PHY > on > the Lanner MR-320. An actual driver for the switch PHY will come later. > Note that for now it intercepts and fakes MII_BMSR reads to prevent the > miibus from talking to anything but the switch itself. Hi Juli, Here's some related work we've done for this switch family, although not fully featured (the user space config is still missing etc.) Maybe it can ease your efforts somehow: http://people.freebsd.org/~raj/misc/e6000sw.c Rafal ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r227730 - in head/sys: arm/conf arm/mv boot/fdt/dts dev/cesa
Author: raj Date: Sat Nov 19 16:30:06 2011 New Revision: 227730 URL: http://svn.freebsd.org/changeset/base/227730 Log: Initial version of cesa(4) driver for Marvell crypto engine and security accelerator. The following algorithms and schemes are supported: - 3DES, AES, DES - MD5, SHA1 Obtained from:Semihalf Written by: Piotr Ziecik Added: head/sys/dev/cesa/ head/sys/dev/cesa/cesa.c (contents, props changed) head/sys/dev/cesa/cesa.h (contents, props changed) Modified: head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/SHEEVAPLUG head/sys/arm/mv/files.mv head/sys/boot/fdt/dts/db88f6281.dts head/sys/boot/fdt/dts/sheevaplug.dts Modified: head/sys/arm/conf/DB-88F6XXX == --- head/sys/arm/conf/DB-88F6XXXSat Nov 19 15:08:49 2011 (r227729) +++ head/sys/arm/conf/DB-88F6XXXSat Nov 19 16:30:06 2011 (r227730) @@ -66,6 +66,10 @@ device mii device e1000phy device bpf +device cesa# Marvell security engine +device crypto +device cryptodev + # USB optionsUSB_DEBUG # enable debug msgs device usb Modified: head/sys/arm/conf/SHEEVAPLUG == --- head/sys/arm/conf/SHEEVAPLUGSat Nov 19 15:08:49 2011 (r227729) +++ head/sys/arm/conf/SHEEVAPLUGSat Nov 19 16:30:06 2011 (r227730) @@ -60,6 +60,10 @@ options HZ=1000 optionsDEVICE_POLLING device vlan +device cesa# Marvell security engine +device crypto +device cryptodev + # USB optionsUSB_DEBUG # enable debug msgs device usb Modified: head/sys/arm/mv/files.mv == --- head/sys/arm/mv/files.mvSat Nov 19 15:08:49 2011(r227729) +++ head/sys/arm/mv/files.mvSat Nov 19 16:30:06 2011(r227730) @@ -28,6 +28,7 @@ arm/mv/mv_sata.c optionalata | atamvsa arm/mv/timer.c standard arm/mv/twsi.c optionaliicbus +dev/cesa/cesa.coptionalcesa dev/mge/if_mge.c optionalmge dev/mvs/mvs_soc.c optionalmvs dev/uart/uart_dev_ns8250.c optionaluart Modified: head/sys/boot/fdt/dts/db88f6281.dts == --- head/sys/boot/fdt/dts/db88f6281.dts Sat Nov 19 15:08:49 2011 (r227729) +++ head/sys/boot/fdt/dts/db88f6281.dts Sat Nov 19 16:30:06 2011 (r227730) @@ -239,6 +239,8 @@ reg = <0x3 0x1>; interrupts = <22>; interrupt-parent = <&PIC>; + + sram-handle = <&SRAM>; }; usb@5 { Modified: head/sys/boot/fdt/dts/sheevaplug.dts == --- head/sys/boot/fdt/dts/sheevaplug.dtsSat Nov 19 15:08:49 2011 (r227729) +++ head/sys/boot/fdt/dts/sheevaplug.dtsSat Nov 19 16:30:06 2011 (r227730) @@ -236,6 +236,8 @@ reg = <0x3 0x1>; interrupts = <22>; interrupt-parent = <&PIC>; + + sram-handle = <&SRAM>; }; usb@5 { Added: head/sys/dev/cesa/cesa.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cesa/cesa.cSat Nov 19 16:30:06 2011(r227730) @@ -0,0 +1,1614 @@ +/*- + * Copyright (C) 2009-2011 Semihalf. + * All rights reserved. + * + * 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;
svn commit: r228504 - head/sys/arm/arm
Author: raj Date: Wed Dec 14 17:12:59 2011 New Revision: 228504 URL: http://svn.freebsd.org/changeset/base/228504 Log: Make *intr{cnt,names} on ARM reside in data section, similar to other arches. sintrnames and sintrcnt are initialized with non-zero values, which were discarded by the .bss directive, so consumers like "vmstat -i" were not getting correct data. Submitted by: Lukasz Plachno Obtained from:Semihalf MFC after:1 month Modified: head/sys/arm/arm/irq_dispatch.S Modified: head/sys/arm/arm/irq_dispatch.S == --- head/sys/arm/arm/irq_dispatch.S Wed Dec 14 16:47:53 2011 (r228503) +++ head/sys/arm/arm/irq_dispatch.S Wed Dec 14 17:12:59 2011 (r228504) @@ -98,10 +98,9 @@ ASENTRY_NP(irq_entry) PULLFRAMEFROMSVCANDEXIT movspc, lr /* Exit */ - .bss + .data .align 0 - .global _C_LABEL(intrnames), _C_LABEL(sintrnames) .global _C_LABEL(intrcnt), _C_LABEL(sintrcnt) _C_LABEL(intrnames): ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r228530 - in head/sys/arm: arm include
Author: raj Date: Thu Dec 15 12:14:15 2011 New Revision: 228530 URL: http://svn.freebsd.org/changeset/base/228530 Log: ARM pmap fixes: - Write Buffers have to be drained after write to Page Table even if caches are in write-through mode. - Make sure to sync PTE in pmap_zero_page_generic(). Submitted by: Michal Mazur Reviewed by: cognet Obtained from:Semihalf MFC after:1 month Modified: head/sys/arm/arm/pmap.c head/sys/arm/include/pmap.h Modified: head/sys/arm/arm/pmap.c == --- head/sys/arm/arm/pmap.c Thu Dec 15 11:21:56 2011(r228529) +++ head/sys/arm/arm/pmap.c Thu Dec 15 12:14:15 2011(r228530) @@ -4039,6 +4039,7 @@ pmap_zero_page_generic(vm_paddr_t phys, * order to work without corruption when write-allocate is enabled. */ *cdst_pte = L2_S_PROTO | phys | L2_S_PROT(PTE_KERNEL, VM_PROT_WRITE); + PTE_SYNC(cdst_pte); cpu_tlb_flushD_SE(cdstp); cpu_cpwait(); if (off || size != PAGE_SIZE) Modified: head/sys/arm/include/pmap.h == --- head/sys/arm/include/pmap.h Thu Dec 15 11:21:56 2011(r228529) +++ head/sys/arm/include/pmap.h Thu Dec 15 12:14:15 2011(r228530) @@ -382,7 +382,8 @@ do { \ if (PMAP_NEEDS_PTE_SYNC) { \ cpu_dcache_wb_range((vm_offset_t)(pte), sizeof(pt_entry_t));\ cpu_l2cache_wb_range((vm_offset_t)(pte), sizeof(pt_entry_t));\ - }\ + } else \ + cpu_drain_writebuf(); \ } while (/*CONSTCOND*/0) #definePTE_SYNC_RANGE(pte, cnt) \ @@ -392,7 +393,8 @@ do { \ (cnt) << 2); /* * sizeof(pt_entry_t) */ \ cpu_l2cache_wb_range((vm_offset_t)(pte),\ (cnt) << 2); /* * sizeof(pt_entry_t) */ \ - } \ + } else \ + cpu_drain_writebuf(); \ } while (/*CONSTCOND*/0) extern pt_entry_t pte_l1_s_cache_mode; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215119 - in head/sys/powerpc: booke include
Author: raj Date: Thu Nov 11 13:35:23 2010 New Revision: 215119 URL: http://svn.freebsd.org/changeset/base/215119 Log: Use local TLB_UNLOCKED marker instead of MTX_UNOWNED for Book-E PowerPC trap routines. This unbreaks Book-E build after the recent machine/mutex.h removal. While there move tlb_*lock() prototypes to machine/tlb.h. Submitted by: jhb Modified: head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/booke/trap_subr.S head/sys/powerpc/include/tlb.h Modified: head/sys/powerpc/booke/machdep.c == --- head/sys/powerpc/booke/machdep.cThu Nov 11 12:13:41 2010 (r215118) +++ head/sys/powerpc/booke/machdep.cThu Nov 11 13:35:23 2010 (r215119) @@ -453,7 +453,7 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpu ptr = &tlb0_miss_locks[cpuid * words_per_gran]; pcpu->pc_booke_tlb_lock = ptr; - *ptr = MTX_UNOWNED; + *ptr = TLB_UNLOCKED; *(ptr + 1) = 0; /* recurse counter */ #endif } Modified: head/sys/powerpc/booke/pmap.c == --- head/sys/powerpc/booke/pmap.c Thu Nov 11 12:13:41 2010 (r215118) +++ head/sys/powerpc/booke/pmap.c Thu Nov 11 13:35:23 2010 (r215119) @@ -162,8 +162,6 @@ unsigned int kernel_ptbls; /* Number of #define PMAP_REMOVE_DONE(pmap) \ ((pmap) != kernel_pmap && (pmap)->pm_stats.resident_count == 0) -extern void tlb_lock(uint32_t *); -extern void tlb_unlock(uint32_t *); extern void tid_flush(tlbtid_t); /**/ Modified: head/sys/powerpc/booke/trap_subr.S == --- head/sys/powerpc/booke/trap_subr.S Thu Nov 11 12:13:41 2010 (r215118) +++ head/sys/powerpc/booke/trap_subr.S Thu Nov 11 13:35:23 2010 (r215119) @@ -330,7 +330,7 @@ lwz %r22, PC_BOOKE_TLB_LOCK(%r20); \ \ 1: lwarx %r23, 0, %r22; \ - cmpwi %r23, MTX_UNOWNED; \ + cmpwi %r23, TLB_UNLOCKED; \ beq 2f; \ \ /* check if this is recursion */\ @@ -364,7 +364,7 @@ msync; \ \ /* release the lock */ \ - li %r23, MTX_UNOWNED; \ + li %r23, TLB_UNLOCKED; \ stw %r23, 0(%r22); \ 1: isync; \ msync @@ -860,7 +860,7 @@ ENTRY(tlb_lock) GET_CPUINFO(%r5) lwz %r5, PC_CURTHREAD(%r5) 1: lwarx %r4, 0, %r3 - cmpwi %r4, MTX_UNOWNED + cmpwi %r4, TLB_UNLOCKED bne 1b stwcx. %r5, 0, %r3 bne-1b @@ -871,11 +871,12 @@ ENTRY(tlb_lock) ENTRY(tlb_unlock) isync msync - li %r4, MTX_UNOWNED + li %r4, TLB_UNLOCKED stw %r4, 0(%r3) isync msync blr + /* * TLB miss spin locks. For each CPU we have a reservation granule (32 bytes); * only a single word from this granule will actually be used as a spin lock Modified: head/sys/powerpc/include/tlb.h == --- head/sys/powerpc/include/tlb.h Thu Nov 11 12:13:41 2010 (r215118) +++ head/sys/powerpc/include/tlb.h Thu Nov 11 13:35:23 2010 (r215119) @@ -129,6 +129,8 @@ #define TID_MAX255 #define TID_NONE -1 +#define TLB_UNLOCKED 0 + #if !defined(LOCORE) typedef struct tlb_entry { uint32_t mas1; @@ -146,6 +148,9 @@ void tlb1_init(vm_offset_t); void tlb1_print_entries(void); void tlb1_print_tlbentries(void); +void tlb_lock(uint32_t *); +void tlb_unlock(uint32_t *); + #endif /* !LOCORE */ #endif /* _MACHINE_TLB_H_ */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215120 - head/sys/dev/ofw
Author: raj Date: Thu Nov 11 13:42:46 2010 New Revision: 215120 URL: http://svn.freebsd.org/changeset/base/215120 Log: Return IEEE 1275 compliant error codes. Submitted by: nwhitehorn Modified: head/sys/dev/ofw/ofw_fdt.c Modified: head/sys/dev/ofw/ofw_fdt.c == --- head/sys/dev/ofw/ofw_fdt.c Thu Nov 11 13:35:23 2010(r215119) +++ head/sys/dev/ofw/ofw_fdt.c Thu Nov 11 13:42:46 2010(r215120) @@ -221,7 +221,7 @@ ofw_fdt_instance_to_package(ofw_t ofw, i */ offset = fdt_node_offset_by_phandle(fdtp, instance); if (offset < 0) - return (0); + return (-1); p = (phandle_t)fdt_offset_ptr(fdtp, offset, sizeof(phandle_t)); return (p); @@ -236,7 +236,7 @@ ofw_fdt_getproplen(ofw_t ofw, phandle_t offset = fdt_phandle_offset(package); if (offset < 0) - return (0); + return (-1); if (strcmp(propname, "name") == 0) { /* Emulate the 'name' property */ @@ -244,7 +244,7 @@ ofw_fdt_getproplen(ofw_t ofw, phandle_t return (len + 1); } - len = 0; + len = -1; prop = fdt_get_property(fdtp, offset, propname, &len); return (len); @@ -261,7 +261,7 @@ ofw_fdt_getprop(ofw_t ofw, phandle_t pac offset = fdt_phandle_offset(package); if (offset < 0) - return (0); + return (-1); if (strcmp(propname, "name") == 0) { /* Emulate the 'name' property */ @@ -274,7 +274,7 @@ ofw_fdt_getprop(ofw_t ofw, phandle_t pac prop = fdt_getprop(fdtp, offset, propname, &len); if (prop == NULL) - return (0); + return (-1); if (len > buflen) len = buflen; @@ -314,7 +314,7 @@ fdt_nextprop(int offset, char *buf, size depth = -1; } while (depth >= 0); - return (0); + return (-1); } /* @@ -330,7 +330,7 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t pa offset = fdt_phandle_offset(package); if (offset < 0) - return (0); + return (-1); if (previous == NULL) /* Find the first prop in the node */ @@ -341,7 +341,7 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t pa */ prop = fdt_get_property(fdtp, offset, previous, NULL); if (prop == NULL) - return (0); + return (-1); offset = fdt_phandle_offset((phandle_t)prop); rv = fdt_nextprop(offset, buf, size); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215121 - in head/sys/powerpc: aim booke
Author: raj Date: Thu Nov 11 13:46:28 2010 New Revision: 215121 URL: http://svn.freebsd.org/changeset/base/215121 Log: Fix typo in the comment. Modified: head/sys/powerpc/aim/clock.c head/sys/powerpc/booke/clock.c Modified: head/sys/powerpc/aim/clock.c == --- head/sys/powerpc/aim/clock.cThu Nov 11 13:42:46 2010 (r215120) +++ head/sys/powerpc/aim/clock.cThu Nov 11 13:46:28 2010 (r215121) @@ -105,7 +105,7 @@ static struct timecounter decr_tc = { }; /* - * Decrementor interrupt handler. + * Decrementer interrupt handler. */ void decr_intr(struct trapframe *frame) Modified: head/sys/powerpc/booke/clock.c == --- head/sys/powerpc/booke/clock.c Thu Nov 11 13:42:46 2010 (r215120) +++ head/sys/powerpc/booke/clock.c Thu Nov 11 13:46:28 2010 (r215121) @@ -108,7 +108,7 @@ static struct timecounter decr_timecount }; /* - * Decrementor interrupt handler. + * Decrementer interrupt handler. */ void decr_intr(struct trapframe *frame) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215122 - head/sys/boot/fdt/dts
Author: raj Date: Thu Nov 11 13:48:48 2010 New Revision: 215122 URL: http://svn.freebsd.org/changeset/base/215122 Log: Correct RAM size of the MPC8555CDS board. Modified: head/sys/boot/fdt/dts/mpc8555cds.dts Modified: head/sys/boot/fdt/dts/mpc8555cds.dts == --- head/sys/boot/fdt/dts/mpc8555cds.dtsThu Nov 11 13:46:28 2010 (r215121) +++ head/sys/boot/fdt/dts/mpc8555cds.dtsThu Nov 11 13:48:48 2010 (r215122) @@ -97,7 +97,7 @@ memory { device_type = "memory"; - reg = <0x0 0x800>; // 128M at 0x0 + reg = <0x0 0x1000>; // 256M at 0x0 }; local...@e0005000 { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r196531 - in head/sys/arm/mv: . discovery kirkwood orion
Author: raj Date: Tue Aug 25 09:30:03 2009 New Revision: 196531 URL: http://svn.freebsd.org/changeset/base/196531 Log: Eliminate platform_pmap_init() to simplify Marvell bootstrap code. Modified: head/sys/arm/mv/discovery/db78xxx.c head/sys/arm/mv/kirkwood/db88f6xxx.c head/sys/arm/mv/mv_machdep.c head/sys/arm/mv/mvvar.h head/sys/arm/mv/orion/db88f5xxx.c Modified: head/sys/arm/mv/discovery/db78xxx.c == --- head/sys/arm/mv/discovery/db78xxx.c Tue Aug 25 07:52:09 2009 (r196530) +++ head/sys/arm/mv/discovery/db78xxx.c Tue Aug 25 09:30:03 2009 (r196531) @@ -68,11 +68,8 @@ __FBSDID("$FreeBSD$"); * 0x_2000 - 0x_ : unused (~55KB) */ -const struct pmap_devmap *pmap_devmap_bootstrap_table; -vm_offset_t pmap_bootstrap_lastaddr; - /* Static device mappings. */ -static const struct pmap_devmap pmap_devmap[] = { +const struct pmap_devmap pmap_devmap[] = { /* * Map the on-board devices VA == PA so that we can access them * with the MMU on or off. @@ -105,16 +102,6 @@ const struct gpio_config mv_gpio_config[ { -1, -1, -1 } }; -int -platform_pmap_init(void) -{ - - pmap_bootstrap_lastaddr = MV_BASE - ARM_NOCACHE_KVA_SIZE; - pmap_devmap_bootstrap_table = &pmap_devmap[0]; - - return (0); -} - void platform_mpp_init(void) { Modified: head/sys/arm/mv/kirkwood/db88f6xxx.c == --- head/sys/arm/mv/kirkwood/db88f6xxx.cTue Aug 25 07:52:09 2009 (r196530) +++ head/sys/arm/mv/kirkwood/db88f6xxx.cTue Aug 25 09:30:03 2009 (r196531) @@ -68,11 +68,8 @@ __FBSDID("$FreeBSD$"); * 0x_2000 - 0x_ : unused (~55KB) */ -const struct pmap_devmap *pmap_devmap_bootstrap_table; -vm_offset_t pmap_bootstrap_lastaddr; - /* Static device mappings. */ -static const struct pmap_devmap pmap_devmap[] = { +const struct pmap_devmap pmap_devmap[] = { /* * Map the on-board devices VA == PA so that we can access them * with the MMU on or off. @@ -105,16 +102,6 @@ const struct gpio_config mv_gpio_config[ { -1, -1, -1 } }; -int -platform_pmap_init(void) -{ - - pmap_bootstrap_lastaddr = MV_BASE - ARM_NOCACHE_KVA_SIZE; - pmap_devmap_bootstrap_table = &pmap_devmap[0]; - - return (0); -} - void platform_mpp_init(void) { Modified: head/sys/arm/mv/mv_machdep.c == --- head/sys/arm/mv/mv_machdep.cTue Aug 25 07:52:09 2009 (r196530) +++ head/sys/arm/mv/mv_machdep.cTue Aug 25 09:30:03 2009 (r196531) @@ -86,6 +86,7 @@ __FBSDID("$FreeBSD$"); #include #include /* XXX eventually this should be eliminated */ +#include #ifdef DEBUG #define debugf(fmt, args...) printf(fmt, ##args) @@ -133,7 +134,9 @@ struct pcpu *pcpup = &__pcpu; vm_paddr_t phys_avail[10]; vm_paddr_t dump_avail[4]; vm_offset_t physical_pages; +vm_offset_t pmap_bootstrap_lastaddr; +const struct pmap_devmap *pmap_devmap_bootstrap_table; struct pv_addr systempage; struct pv_addr msgbufpv; struct pv_addr irqstack; @@ -423,8 +426,8 @@ initarm(void *mdp, void *unused __unused while (1); /* Platform-specific initialisation */ - if (platform_pmap_init() != 0) - return (NULL); + pmap_bootstrap_lastaddr = MV_BASE - ARM_NOCACHE_KVA_SIZE; + pmap_devmap_bootstrap_table = &pmap_devmap[0]; pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); Modified: head/sys/arm/mv/mvvar.h == --- head/sys/arm/mv/mvvar.h Tue Aug 25 07:52:09 2009(r196530) +++ head/sys/arm/mv/mvvar.h Tue Aug 25 09:30:03 2009(r196531) @@ -41,6 +41,10 @@ #define _MVVAR_H_ #include +#include +#include +#include +#include #defineMV_TYPE_PCI 0 #defineMV_TYPE_PCIE1 @@ -104,6 +108,7 @@ struct decode_win { int remap; }; +extern const struct pmap_devmap pmap_devmap[]; extern const struct obio_pci mv_pci_info[]; extern const struct gpio_config mv_gpio_config[]; extern bus_space_tag_t obio_tag; @@ -124,7 +129,6 @@ int mv_gpio_configure(uint32_t pin, uint void mv_gpio_out(uint32_t pin, uint8_t val, uint8_t enable); uint8_t mv_gpio_in(uint32_t pin); -int platform_pmap_init(void); void platform_mpp_init(void); int soc_decode_win(void); void soc_id(uint32_t *dev, uint32_t *rev); Modified: head/sys/arm/mv/orion/db88f5xxx.c == --- head/sys/arm/mv/orion/db88f5xxx.c Tue Aug 25 07:52:09 2009 (r196530) +++ head/sys/arm/mv/orion/db88f5xxx.c Tue Aug 25 09:30:03 2009 (r196531) @@ -70,12 +70,10 @@ __FBSDID("$FreeBSD$");
svn commit: r196532 - head/sys/arm/mv
Author: raj Date: Tue Aug 25 09:35:50 2009 New Revision: 196532 URL: http://svn.freebsd.org/changeset/base/196532 Log: Properly handle initial state of power mgmt. Modules on Marvell SOC can be selectively PM-disabled, and we must not access disabled devices' registers (attempt to initialize them) unconditionally, as this leads to the system hang. This patch introduces graceful handling of the PM state during devices init. Submitted by: Michal Hajduk Obtained from:Semihalf Modified: head/sys/arm/mv/common.c head/sys/arm/mv/mvreg.h head/sys/arm/mv/mvvar.h Modified: head/sys/arm/mv/common.c == --- head/sys/arm/mv/common.cTue Aug 25 09:30:03 2009(r196531) +++ head/sys/arm/mv/common.cTue Aug 25 09:35:50 2009(r196532) @@ -32,8 +32,10 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include +#include #include @@ -62,6 +64,76 @@ static void decode_win_usb_dump(void); static uint32_t used_cpu_wins; +static __inline int +pm_is_disabled(uint32_t mask) +{ + + return (soc_power_ctrl_get(mask) == mask ? 0 : 1); +} + +static __inline uint32_t +obio_get_pm_mask(uint32_t base) +{ + struct obio_device *od; + + for (od = obio_devices; od->od_name != NULL; od++) + if (od->od_base == base) + return (od->od_pwr_mask); + + return (CPU_PM_CTRL_NONE); +} + +/* + * Disable device using power management register. + * 1 - Device Power On + * 0 - Device Power Off + * Mask can be set in loader. + * EXAMPLE: + * loader> set hw.pm-disable-mask=0x2 + * + * Common mask: + * |---| + * | Device | Kirkwood | Discovery | + * |---| + * | USB0 | 0x8 | 0x02 | + * |---| + * | USB1 | -| 0x04 | + * |---| + * | USB2 | -| 0x08 | + * |---| + * | GE0| 0x1 | 0x02 | + * |---| + * | GE1| -| 0x04 | + * |---| + * | IDMA | -| 0x10 | + * |---| + * | XOR| 0x1 | 0x20 | + * |---| + * | CESA | 0x2 | 0x40 | + * |---| + * | SATA | 0x04000 | 0x004000 | + * | + * This feature can be used only on Kirkwood and Discovery + * machines. + */ +static __inline void +pm_disable_device(int mask) +{ +#ifdef DIAGNOSTIC + uint32_t reg; + + reg = soc_power_ctrl_get(CPU_PM_CTRL_ALL); + printf("Power Management Register: 0%x\n", reg); + + reg &= ~mask; + soc_power_ctrl_set(reg); + printf("Device %x is disabled\n", mask); + + reg = soc_power_ctrl_get(CPU_PM_CTRL_ALL); + printf("Power Management Register: 0%x\n", reg); +#endif +} + uint32_t read_cpu_ctrl(uint32_t reg) { @@ -103,14 +175,36 @@ cpu_extra_feat(void) return (ef); } +/* + * Get the power status of device. This feature is only supported on + * Kirkwood and Discovery SoCs. + */ uint32_t soc_power_ctrl_get(uint32_t mask) { +#ifndef SOC_MV_ORION if (mask != CPU_PM_CTRL_NONE) mask &= read_cpu_ctrl(CPU_PM_CTRL); return (mask); +#else + return (mask); +#endif +} + +/* + * Set the power status of device. This feature is only supported on + * Kirkwood and Discovery SoCs. + */ +void +soc_power_ctrl_set(uint32_t mask) +{ + +#ifndef SOC_MV_ORION + if (mask != CPU_PM_CTRL_NONE) + write_cpu_ctrl(CPU_PM_CTRL, mask); +#endif } void @@ -191,6 +285,13 @@ int soc_decode_win(void) { uint32_t dev, rev; + int mask; + + mask = 0; + TUNABLE_INT_FETCH("hw.pm-disable-mask", &mask); + + if (mask != 0) + pm_disable_device(mask); /* Retrieve our ID: some windows facilities vary between SoC models */ soc_id(&dev, &rev); @@ -623,8 +724,12 @@ decode_win_usb_setup(void) /* Disable and clear all USB windows for all ports */ m = usb_max_ports(); + for (p = 0; p < m; p++) { + if (pm_is_disabled(CPU_PM_CTRL_USB(p))) + continue; + for (i = 0; i < MV_WIN_USB_MAX; i++) { win_usb_cr_write(i, p, 0); win_usb_br_write(i, p, 0); @@ -710,6 +815,9 @@ decode_win_eth_setup(uint32_t base) uint32_t br, sz; int i, j; + if (pm_is_disabled(obio_get_pm_mask(base))) + return; + /* Disable, clear and revoke protection for all ETH windows */ for (i = 0; i < MV_WIN_ETH_MAX; i++) { @@ -880,6 +988,8 @@ decode_win_idma_setup(void) uint32_t br, sz; int i, j; + if (pm_is_disabled(CPU_PM_CTRL_IDMA)) + return; /* * Di
svn commit: r196533 - head/sys/arm/mv/kirkwood
Author: raj Date: Tue Aug 25 09:39:11 2009 New Revision: 196533 URL: http://svn.freebsd.org/changeset/base/196533 Log: Exclude common Kirkwood settings so they can be shared among various platforms based on this SOC. This is a preliminary step for SheevaPlug support. Submitted by: Michal Hajduk Obtained from:Semihalf Added: head/sys/arm/mv/kirkwood/files.kirkwood (contents, props changed) head/sys/arm/mv/kirkwood/std.kirkwood (contents, props changed) Modified: head/sys/arm/mv/kirkwood/files.db88f6xxx head/sys/arm/mv/kirkwood/std.db88f6xxx Modified: head/sys/arm/mv/kirkwood/files.db88f6xxx == --- head/sys/arm/mv/kirkwood/files.db88f6xxxTue Aug 25 09:35:50 2009 (r196532) +++ head/sys/arm/mv/kirkwood/files.db88f6xxxTue Aug 25 09:39:11 2009 (r196533) @@ -1,5 +1,4 @@ # $FreeBSD$ -arm/mv/rtc.c standard -arm/mv/kirkwood/kirkwood.c standard +include "arm/mv/kirkwood/files.kirkwood" arm/mv/kirkwood/db88f6xxx.cstandard Added: head/sys/arm/mv/kirkwood/files.kirkwood == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/mv/kirkwood/files.kirkwood Tue Aug 25 09:39:11 2009 (r196533) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +arm/mv/rtc.c standard +arm/mv/kirkwood/kirkwood.c standard Modified: head/sys/arm/mv/kirkwood/std.db88f6xxx == --- head/sys/arm/mv/kirkwood/std.db88f6xxx Tue Aug 25 09:35:50 2009 (r196532) +++ head/sys/arm/mv/kirkwood/std.db88f6xxx Tue Aug 25 09:39:11 2009 (r196533) @@ -1,13 +1,8 @@ # $FreeBSD$ include"../mv/std.mv" +include "../mv/kirkwood/std.kirkwood" files "../mv/kirkwood/files.db88f6xxx" -makeoptionsKERNPHYSADDR=0x0090 -makeoptionsKERNVIRTADDR=0xc090 -optionsKERNPHYSADDR=0x0090 -optionsKERNVIRTADDR=0xc090 -optionsPHYSADDR=0x optionsPHYSMEM_SIZE=0x2000 -optionsSTARTUP_PAGETABLE_ADDR=0x0010 Added: head/sys/arm/mv/kirkwood/std.kirkwood == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/mv/kirkwood/std.kirkwood Tue Aug 25 09:39:11 2009 (r196533) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +# kernel gets loaded at 0x0090 by the loader, but runs at virtual address +# 0xc090. RAM starts at 0. We put the pagetable at a reasonable place +# in memory, but may need to bounce it higher if there's a problem with this. +# We could paper over this by loading the kernel at 0xc000 virtual, but +# that leads to other complications, so we'll just reclaim the lower region of +# ram after we're loaded. Put the page tables for startup at 1MB. +makeoptionsKERNPHYSADDR=0x0090 +makeoptionsKERNVIRTADDR=0xc090 + +optionsKERNPHYSADDR=0x0090 +optionsKERNVIRTADDR=0xc090 +optionsPHYSADDR=0x +optionsSTARTUP_PAGETABLE_ADDR=0x0010 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r196534 - in head/sys: conf dev/mge
Author: raj Date: Tue Aug 25 09:47:12 2009 New Revision: 196534 URL: http://svn.freebsd.org/changeset/base/196534 Log: Introduce MII_ADDR_BASE option on ARM, which allows to override the default per platform requirements. Notes: - Only used by mge(4) at the moment. - This is very simplified approach and should be replaced by some long-term solution for managing the board/platform configuration (among others the MAC-PHY binding info). Submitted by: Michal Hajduk Obtained from:Semihalf Modified: head/sys/conf/options.arm head/sys/dev/mge/if_mge.c Modified: head/sys/conf/options.arm == --- head/sys/conf/options.arm Tue Aug 25 09:39:11 2009(r196533) +++ head/sys/conf/options.arm Tue Aug 25 09:47:12 2009(r196534) @@ -24,6 +24,7 @@ KERNVIRTADDR opt_global.h LOADERRAMADDR opt_global.h PHYSADDR opt_global.h PHYSMEM_SIZE opt_global.h +MII_ADDR_BASE opt_global.h SKYEYE_WORKAROUNDS opt_global.h SOC_MV_DISCOVERY opt_global.h SOC_MV_KIRKWOODopt_global.h Modified: head/sys/dev/mge/if_mge.c == --- head/sys/dev/mge/if_mge.c Tue Aug 25 09:39:11 2009(r196533) +++ head/sys/dev/mge/if_mge.c Tue Aug 25 09:47:12 2009(r196534) @@ -69,7 +69,9 @@ __FBSDID("$FreeBSD$"); #include #include -#defineMV_PHY_ADDR_BASE8 +#ifndef MII_ADDR_BASE +#define MII_ADDR_BASE 8 +#endif #include #include @@ -1264,14 +1266,15 @@ mge_miibus_readreg(device_t dev, int phy /* * We assume static PHY address <=> device unit mapping: -* PHY Address = MV_PHY_ADDR_BASE + devce unit. +* PHY Address = MII_ADDR_BASE + devce unit. * This is true for most Marvell boards. * * Code below grants proper PHY detection on each device * unit. */ - if ((MV_PHY_ADDR_BASE + device_get_unit(dev)) != phy) + + if ((MII_ADDR_BASE + device_get_unit(dev)) != phy) return (0); MGE_WRITE(sc_mge0, MGE_REG_SMI, 0x1fff & @@ -1292,7 +1295,7 @@ mge_miibus_writereg(device_t dev, int ph { uint32_t retries; - if ((MV_PHY_ADDR_BASE + device_get_unit(dev)) != phy) + if ((MII_ADDR_BASE + device_get_unit(dev)) != phy) return (0); MGE_WRITE(sc_mge0, MGE_REG_SMI, 0x1fff & ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r196536 - in head/sys/arm: conf mv/kirkwood
Author: raj Date: Tue Aug 25 10:09:25 2009 New Revision: 196536 URL: http://svn.freebsd.org/changeset/base/196536 Log: Introduce SheevaPlug support. - The device is based on Marvell 88F6281 system on chip. - More info about the platform at http://www.plugcomputer.org - To build the FreeBSD kernel: make buildkernel TARGET_ARCH=arm KERNCONF=SHEEVAPLUG - Installation notes at: http://wiki.freebsd.org/FreeBSDMarvell Submitted by: Michal Hajduk Obtained from:Semihalf Added: head/sys/arm/conf/SHEEVAPLUG (contents, props changed) head/sys/arm/mv/kirkwood/files.sheevaplug (contents, props changed) head/sys/arm/mv/kirkwood/sheevaplug.c (contents, props changed) head/sys/arm/mv/kirkwood/std.sheevaplug (contents, props changed) Added: head/sys/arm/conf/SHEEVAPLUG == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/SHEEVAPLUGTue Aug 25 10:09:25 2009 (r196536) @@ -0,0 +1,70 @@ +# +# Custom kernel for Marvell SheevaPlug devices. +# +# $FreeBSD$ +# + +ident SHEEVAPLUG +include"../mv/kirkwood/std.sheevaplug" + +optionsSOC_MV_KIRKWOOD +makeoptionsMODULES_OVERRIDE="" + +#makeoptions DEBUG=-g#Build kernel with gdb(1) debug symbols +makeoptionsWERROR="-Werror" + +optionsSCHED_4BSD #4BSD scheduler +optionsINET#InterNETworking +optionsINET6 #IPv6 communications protocols +optionsFFS #Berkeley Fast Filesystem +optionsNFSCLIENT #Network Filesystem Client +optionsNFSLOCKD#Network Lock Manager +optionsNFS_ROOT#NFS usable as /, requires NFSCLIENT +optionsBOOTP +optionsBOOTP_NFSROOT +optionsBOOTP_NFSV3 +optionsBOOTP_WIRED_TO=mge0 + +# Root fs on USB device +#options ROOTDEVNAME=\"ufs:/dev/da0a\" + +optionsSYSVSHM #SYSV-style shared memory +optionsSYSVMSG #SYSV-style message queues +optionsSYSVSEM #SYSV-style semaphores +options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +optionsMUTEX_NOINLINE +optionsRWLOCK_NOINLINE +optionsNO_FFS_SNAPSHOT +optionsNO_SWAPPING + +# Debugging +optionsALT_BREAK_TO_DEBUGGER +optionsDDB +optionsKDB + +# Pseudo devices +device random +device pty +device loop + +# Serial ports +device uart + +# Networking +device ether +device mge # Marvell Gigabit Ethernet controller +device mii +device e1000phy +device bpf +optionsHZ=1000 +optionsDEVICE_POLLING +device vlan + +# USB +device usb +device ehci +device umass +device scbus +device pass +device da + Added: head/sys/arm/mv/kirkwood/files.sheevaplug == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/mv/kirkwood/files.sheevaplug Tue Aug 25 10:09:25 2009 (r196536) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +include "arm/mv/kirkwood/files.kirkwood" +arm/mv/kirkwood/sheevaplug.c standard Added: head/sys/arm/mv/kirkwood/sheevaplug.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/mv/kirkwood/sheevaplug.c Tue Aug 25 10:09:25 2009 (r196536) @@ -0,0 +1,152 @@ +/*- + * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. + * Copyright (C) 2009 Semihalf + * All rights reserved. + * + * 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. + * 3. Neither the name of MARVELL nor the names of contributors + *may be used to endorse or promote products derived from this software + *without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY 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 AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUEN
svn commit: r197251 - in stable/8/sys: . amd64/include/xen arm/conf arm/mv arm/mv/discovery arm/mv/kirkwood arm/mv/orion cddl/contrib/opensolaris conf contrib/dev/acpica contrib/pf dev/mge dev/xen/...
Author: raj Date: Wed Sep 16 12:07:58 2009 New Revision: 197251 URL: http://svn.freebsd.org/changeset/base/197251 Log: MFC r196531-196534,196536 Clean up Marvell platform code. Introduce SheevaPlug support. - The device is based on Marvell 88F6281 system on chip. - More info about the platform at http://www.plugcomputer.org - To build the FreeBSD kernel: make buildkernel TARGET_ARCH=arm KERNCONF=SHEEVAPLUG - Installation notes at: http://wiki.freebsd.org/FreeBSDMarvell Submitted by: Michal Hajduk Approved by: re (kib) Obtained from:Semihalf Added: stable/8/sys/arm/conf/SHEEVAPLUG - copied unchanged from r196536, head/sys/arm/conf/SHEEVAPLUG stable/8/sys/arm/mv/kirkwood/files.kirkwood - copied unchanged from r196533, head/sys/arm/mv/kirkwood/files.kirkwood stable/8/sys/arm/mv/kirkwood/files.sheevaplug - copied unchanged from r196536, head/sys/arm/mv/kirkwood/files.sheevaplug stable/8/sys/arm/mv/kirkwood/sheevaplug.c - copied unchanged from r196536, head/sys/arm/mv/kirkwood/sheevaplug.c stable/8/sys/arm/mv/kirkwood/std.kirkwood - copied unchanged from r196533, head/sys/arm/mv/kirkwood/std.kirkwood stable/8/sys/arm/mv/kirkwood/std.sheevaplug - copied unchanged from r196536, head/sys/arm/mv/kirkwood/std.sheevaplug Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/arm/mv/common.c stable/8/sys/arm/mv/discovery/db78xxx.c stable/8/sys/arm/mv/kirkwood/db88f6xxx.c stable/8/sys/arm/mv/kirkwood/files.db88f6xxx stable/8/sys/arm/mv/kirkwood/std.db88f6xxx stable/8/sys/arm/mv/mv_machdep.c stable/8/sys/arm/mv/mvreg.h stable/8/sys/arm/mv/mvvar.h stable/8/sys/arm/mv/orion/db88f5xxx.c stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/conf/options.arm stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/mge/if_mge.c stable/8/sys/dev/xen/xenpci/ (props changed) Copied: stable/8/sys/arm/conf/SHEEVAPLUG (from r196536, head/sys/arm/conf/SHEEVAPLUG) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/arm/conf/SHEEVAPLUGWed Sep 16 12:07:58 2009 (r197251, copy of r196536, head/sys/arm/conf/SHEEVAPLUG) @@ -0,0 +1,70 @@ +# +# Custom kernel for Marvell SheevaPlug devices. +# +# $FreeBSD$ +# + +ident SHEEVAPLUG +include"../mv/kirkwood/std.sheevaplug" + +optionsSOC_MV_KIRKWOOD +makeoptionsMODULES_OVERRIDE="" + +#makeoptions DEBUG=-g#Build kernel with gdb(1) debug symbols +makeoptionsWERROR="-Werror" + +optionsSCHED_4BSD #4BSD scheduler +optionsINET#InterNETworking +optionsINET6 #IPv6 communications protocols +optionsFFS #Berkeley Fast Filesystem +optionsNFSCLIENT #Network Filesystem Client +optionsNFSLOCKD#Network Lock Manager +optionsNFS_ROOT#NFS usable as /, requires NFSCLIENT +optionsBOOTP +optionsBOOTP_NFSROOT +optionsBOOTP_NFSV3 +optionsBOOTP_WIRED_TO=mge0 + +# Root fs on USB device +#options ROOTDEVNAME=\"ufs:/dev/da0a\" + +optionsSYSVSHM #SYSV-style shared memory +optionsSYSVMSG #SYSV-style message queues +optionsSYSVSEM #SYSV-style semaphores +options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +optionsMUTEX_NOINLINE +optionsRWLOCK_NOINLINE +optionsNO_FFS_SNAPSHOT +optionsNO_SWAPPING + +# Debugging +optionsALT_BREAK_TO_DEBUGGER +optionsDDB +optionsKDB + +# Pseudo devices +device random +device pty +device loop + +# Serial ports +device uart + +# Networking +device ether +device mge # Marvell Gigabit Ethernet controller +device mii +device e1000phy +device bpf +optionsHZ=1000 +optionsDEVICE_POLLING +device vlan + +# USB +device usb +device ehci +device umass +device scbus +device pass +device da + Modified: stable/8/sys/arm/mv/common.c == --- stable/8/sys/arm/mv/common.cWed Sep 16 11:56:44 2009 (r197250) +++ stable/8/sys/arm/mv/common.cWed Sep 16 12:07:58 2009 (r197251) @@ -32,8 +32,10 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include +#include #include @@ -62,6 +64,76 @@ static void decode_win_usb_dump(void); static uint32_t used_cpu_wins; +static __inline int +pm_is_disabled(uint32_t mask) +{ + +
Re: svn commit: r197643 - in head/sys: kern sys
On 2009-10-01, at 15:41, Stanislav Sedov wrote: On Thu, 1 Oct 2009 15:21:34 +0200 Attilio Rao mentioned: 2009/9/30 Robert Watson : On Wed, 30 Sep 2009, Attilio Rao wrote: When releasing a read/shared lock we need to use a write memory barrier in order to avoid, on architectures which doesn't have strong ordered writes, CPU instructions reordering. Hi Attilio (Fabio, et al), Nice catch! Are we aware of specific reported problems that can be laid at the feet of this bug, or was this more of a "wait a moment, shouldn't there be a barrier there?". Could you comment on the scope of this problem across architectures we support? A possible problem related to that would be MD specific and not on ia32/amd64 because there the barriers and simple atomics are the same. Given that sun4v suffers of serveral other problems, that MIPS has no SMP support, you would find it only for arm, ia64 and sparc eventually. Thus I'm not aware of any problem which can be reconducted to that. Actually, MIPS is going to grow SMP support really soon, and ARM cpus do not do reordering until ARMv7 afaik. So this should not result in any real problems on ARM too. Even past generation ARM can do out-of-order execution: see Marvell Feroceon cores which are v5 ISA compatible, although their internal microarchitecture has extended features like this. OTOH, I suspect powerpc may be affected. I'm not sure if any of the models we support perform OOO, though. PowerPC is inherently OOOE. Rafal ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r198341 - in head/sys: amd64/amd64 arm/arm arm/mv i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/aim powerpc/booke powerpc/include powerpc/powerpc sparc64/sparc64 sun4v/sun4v vm
On 2009-10-21, at 20:38, Marcel Moolenaar wrote: The key property of this change is that the I-cache is made coherent *after* writes have been done. Doing it in the PMAP layer when adding or changing a mapping means that the I-cache is made coherent *before* any writes happen. The difference is key when the I-cache prefetches. Marcel, does this new approach help with your problems on MV-78xxx with SATA when executing binaries was failing with various signals etc. (and the suspicions were this was due to some i-cache incoherency)? Rafal ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r227613 - head/sys/boot/fdt/dts
Author: raj Date: Thu Nov 17 12:08:12 2011 New Revision: 227613 URL: http://svn.freebsd.org/changeset/base/227613 Log: Add DTS for the Freescale P2020DS. Obtained from: Freescale Added: head/sys/boot/fdt/dts/p2020ds.dts (contents, props changed) Added: head/sys/boot/fdt/dts/p2020ds.dts == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/p2020ds.dts Thu Nov 17 12:08:12 2011 (r227613) @@ -0,0 +1,754 @@ +/* + * P2020 DS Device Tree Source + * + * Copyright 2009 Freescale Semiconductor Inc. + * + * Neither the name of Freescale Semiconductor, Inc nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Freescale hereby publishes it under the following licenses: + * + * BSD License + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * GNU General Public License, version 2 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + * You may select the license of your choice. + *-- + */ +/* $FreeBSD$ */ + +/dts-v1/; +/ { + model = "fsl,P2020"; + compatible = "fsl,P2020DS"; + #address-cells = <2>; + #size-cells = <2>; + + aliases { + ethernet0 = &enet0; + ethernet1 = &enet1; + ethernet2 = &enet2; + serial0 = &serial0; + serial1 = &serial1; + pci0 = &pci0; + pci1 = &pci1; + pci2 = &pci2; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + PowerPC,P2020@0 { + device_type = "cpu"; + reg = <0x0>; + next-level-cache = <&L2>; + }; + + PowerPC,P2020@1 { + device_type = "cpu"; + reg = <0x1>; + next-level-cache = <&L2>; + }; + }; + + memory { + device_type = "memory"; + }; + + localbus@ffe05000 { + #address-cells = <2>; + #size-cells = <1>; + compatible = "fsl,elbc", "simple-bus"; + reg = <0 0xffe05000 0 0x1000>; + interrupts = <19 2>; + interrupt-parent = <&mpic>; + + ranges = <0x0 0x0 0x0 0xe800 0x0800 + 0x1 0x0 0x0 0xe000 0x0800 + 0x2 0x0 0x0 0xffa0 0x0004 + 0x3 0x0 0x0 0xffdf 0x8000 + 0x4 0x0 0x0 0xffa4 0x0004 + 0x5 0x0 0x0 0xffa8 0x0004 +
Re: svn commit: r216662 - head/share/mk
On 2010-12-22, at 15:59, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Wed Dec 22 14:59:22 2010 > New Revision: 216662 > URL: http://svn.freebsd.org/changeset/base/216662 > > Log: > Enable build of FDT components by default. dtc is a required build tool > for all FDT-enabled kernels, and having it off by default means that > building these kernels fails by default. This fixes FDT-related build > failures in make universe on ARM and PowerPC. > > Reviewed by: imp Thanks a lot for taking care of this! Rafal ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r190701 - head/sys/powerpc/booke
On 2009-04-05, at 00:01, Marcel Moolenaar wrote: Author: marcel Date: Sat Apr 4 22:01:43 2009 New Revision: 190701 URL: http://svn.freebsd.org/changeset/base/190701 Log: Implement kernel core dump support for Book-E processors. Both raw physical memory dumps and virtual minidumps are supported. The default being minidumps. Obtained from: Juniper Networks Thanks, Marcel! Great to see this coming. Rafal ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r190704 - head/sys/powerpc/aim
On 2009-04-05, at 00:23, Marcel Moolenaar wrote: Author: marcel Date: Sat Apr 4 22:23:03 2009 New Revision: 190704 URL: http://svn.freebsd.org/changeset/base/190704 Log: Perform a dummy stwcx. when we switch contexts. The context being switched out may hold a reservation. The stwcx. will clear the reservation. This is architecturally recommended. The scenario this addresses is as follows: 1. Thread 1 performs a lwarx and as such holds a reservation. 2. Thread 1 gets switched out (before doing the matching stwcx.) and thread 2 is switched in. 3. Thread 2 performs a stwcx. to the same reservation granule. This will succeed because the processor has the reservation even though thread 2 didn't do the lwarx. Note that on some processors the address given the stwcx. is not checked. On these processors the mere condition of having a reservation would cause the stwcx. to succeed, irrespective of whether the addresses are the same. The dummy stwcx. is especially important for those processors. Have you seen this false stwcx. actually succeed in some real scenarios on AIM? Were there any tangible [corruption?] effects observed without this fix? We're seeing some hang with the dual E500 under very heavy loads, but only with ULE (or we could only correlate this with ULE so far), but didn't get to really close investigation of this issue yet. I'm wondering if it's something of this sort too. Rafal ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r190844 - head/sys/arm/arm
Author: raj Date: Wed Apr 8 12:54:32 2009 New Revision: 190844 URL: http://svn.freebsd.org/changeset/base/190844 Log: Properly handle KDB entry in fatal abort. This lets KDB_UNATTENDED work on ARM. Submitted by: Grzegorz Bernacki gjb ! semihalf dot com Modified: head/sys/arm/arm/trap.c Modified: head/sys/arm/arm/trap.c == --- head/sys/arm/arm/trap.c Wed Apr 8 12:52:05 2009(r190843) +++ head/sys/arm/arm/trap.c Wed Apr 8 12:54:32 2009(r190844) @@ -520,7 +520,8 @@ dab_fatal(trapframe_t *tf, u_int fsr, u_ printf(", pc =%08x\n\n", tf->tf_pc); #ifdef KDB - kdb_trap(fsr, 0, tf); + if (debugger_on_panic || kdb_active) + kdb_trap(fsr, 0, tf); #endif panic("Fatal abort"); /*NOTREACHED*/ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r190845 - head/sys/arm/arm
Author: raj Date: Wed Apr 8 13:01:18 2009 New Revision: 190845 URL: http://svn.freebsd.org/changeset/base/190845 Log: Minor description fix. Modified: head/sys/arm/arm/trap.c Modified: head/sys/arm/arm/trap.c == --- head/sys/arm/arm/trap.c Wed Apr 8 12:54:32 2009(r190844) +++ head/sys/arm/arm/trap.c Wed Apr 8 13:01:18 2009(r190845) @@ -531,7 +531,7 @@ dab_fatal(trapframe_t *tf, u_int fsr, u_ * dab_align() handles the following data aborts: * * FAULT_ALIGN_0 - Alignment fault - * FAULT_ALIGN_0 - Alignment fault + * FAULT_ALIGN_1 - Alignment fault * * These faults are fatal if they happen in kernel mode. Otherwise, we * deliver a bus error to the process. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r191140 - in head/sys: arm/mv dev/mge
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.cThu Apr 16 11:09:59 2009(r191139) +++ head/sys/arm/mv/common.cThu 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.cThu Apr 16 11:09:59 2009(r191139) +++ head/sys/arm/mv/ic.cThu 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 == M
svn commit: r191141 - head/sys/arm/arm
Author: raj Date: Thu Apr 16 11:21:52 2009 New Revision: 191141 URL: http://svn.freebsd.org/changeset/base/191141 Log: Minor style fixes and better comments. Modified: head/sys/arm/arm/cpufunc_asm_armv5_ec.S head/sys/arm/arm/cpufunc_asm_sheeva.S Modified: head/sys/arm/arm/cpufunc_asm_armv5_ec.S == --- head/sys/arm/arm/cpufunc_asm_armv5_ec.S Thu Apr 16 11:20:18 2009 (r191140) +++ head/sys/arm/arm/cpufunc_asm_armv5_ec.S Thu Apr 16 11:21:52 2009 (r191141) @@ -204,3 +204,4 @@ ENTRY(armv5_ec_dcache_wbinv_all) bne 1b /* More to do? */ mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ RET + Modified: head/sys/arm/arm/cpufunc_asm_sheeva.S == --- head/sys/arm/arm/cpufunc_asm_sheeva.S Thu Apr 16 11:20:18 2009 (r191140) +++ head/sys/arm/arm/cpufunc_asm_sheeva.S Thu Apr 16 11:21:52 2009 (r191141) @@ -375,6 +375,14 @@ ENTRY(sheeva_l2cache_wbinv_all) mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ RET +/* This function modifies register value as follows: + * + * arg1 arg EFFECT (bit value saved into register) + *0 0 not changed + *0 1 negated + *1 0 cleared + *1 1 set + */ ENTRY(sheeva_control_ext) mrc p15, 1, r3, c15, c1, 0 /* Read the control register */ bic r2, r3, r0 /* Clear bits */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r191142 - head/sys/dev/mge
Author: raj Date: Thu Apr 16 11:38:06 2009 New Revision: 191142 URL: http://svn.freebsd.org/changeset/base/191142 Log: mge(4): fix two bugs, which were leading to crash/hang under very heavy network load. 1. Leave the RX interrupt routine if there is no mbuf available. 2. Properly initialize and track tx_desc_used_count counter so as not to leak mbuf while traversing used descriptors. Obtained from:Semihalf Modified: head/sys/dev/mge/if_mge.c Modified: head/sys/dev/mge/if_mge.c == --- head/sys/dev/mge/if_mge.c Thu Apr 16 11:21:52 2009(r191141) +++ head/sys/dev/mge/if_mge.c Thu Apr 16 11:38:06 2009(r191142) @@ -642,6 +642,7 @@ mge_attach(device_t dev) sc->tx_desc_curr = 0; sc->rx_desc_curr = 0; sc->tx_desc_used_idx = 0; + sc->tx_desc_used_count = 0; /* Configure defaults for interrupts coalescing */ sc->rx_ic_time = 768; @@ -899,6 +900,7 @@ mge_init_locked(void *arg) sc->tx_desc_curr = 0; sc->rx_desc_curr = 0; sc->tx_desc_used_idx = 0; + sc->tx_desc_used_count = 0; /* Enable RX descriptors */ for (i = 0; i < MGE_RX_DESC_NUM; i++) { @@ -1022,7 +1024,7 @@ mge_intr_rx_locked(struct mge_softc *sc, MGE_RECEIVE_LOCK_ASSERT(sc); - while(count != 0) { + while (count != 0) { dw = &sc->mge_rx_desc[sc->rx_desc_curr]; bus_dmamap_sync(sc->mge_desc_dtag, dw->desc_dmap, BUS_DMASYNC_POSTREAD); @@ -1033,7 +1035,6 @@ mge_intr_rx_locked(struct mge_softc *sc, if ((status & MGE_DMA_OWNED) != 0) break; - sc->rx_desc_curr = (++sc->rx_desc_curr % MGE_RX_DESC_NUM); if (dw->mge_desc->byte_count && ~(status & MGE_ERR_SUMMARY)) { @@ -1044,6 +1045,10 @@ mge_intr_rx_locked(struct mge_softc *sc, dw->mge_desc->byte_count - ETHER_CRC_LEN, 0, ifp, NULL); + if (mb == NULL) + /* Give up if no mbufs */ + break; + mb->m_len -= 2; mb->m_pkthdr.len -= 2; mb->m_data += 2; @@ -1058,6 +1063,7 @@ mge_intr_rx_locked(struct mge_softc *sc, dw->mge_desc->byte_count = 0; dw->mge_desc->cmd_status = MGE_RX_ENABLE_INT | MGE_DMA_OWNED; + sc->rx_desc_curr = (++sc->rx_desc_curr % MGE_RX_DESC_NUM); bus_dmamap_sync(sc->mge_desc_dtag, dw->desc_dmap, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); @@ -1514,7 +1520,8 @@ mge_stop(struct mge_softc *sc) MGE_WRITE(sc, MGE_RX_QUEUE_CMD, MGE_DISABLE_RXQ_ALL); /* Remove pending data from TX queue */ - while (sc->tx_desc_used_idx < sc->tx_desc_curr) { + while (sc->tx_desc_used_idx != sc->tx_desc_curr && + sc->tx_desc_used_count) { /* Get the descriptor */ dw = &sc->mge_tx_desc[sc->tx_desc_used_idx]; desc = dw->mge_desc; @@ -1529,6 +1536,7 @@ mge_stop(struct mge_softc *sc) sc->tx_desc_used_idx = (++sc->tx_desc_used_idx) % MGE_TX_DESC_NUM; + sc->tx_desc_used_count--; bus_dmamap_sync(sc->mge_tx_dtag, dw->buffer_dmap, BUS_DMASYNC_POSTWRITE); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r191307 - head/sys/powerpc/powerpc
Author: raj Date: Mon Apr 20 12:40:28 2009 New Revision: 191307 URL: http://svn.freebsd.org/changeset/base/191307 Log: Provide locking for PowerPC interrupt sources config. Reviewed by: attilio Modified: head/sys/powerpc/powerpc/intr_machdep.c Modified: head/sys/powerpc/powerpc/intr_machdep.c == --- head/sys/powerpc/powerpc/intr_machdep.c Mon Apr 20 11:51:35 2009 (r191306) +++ head/sys/powerpc/powerpc/intr_machdep.c Mon Apr 20 12:40:28 2009 (r191307) @@ -96,6 +96,7 @@ struct powerpc_intr { u_int vector; }; +static struct mtx intr_table_lock; static struct powerpc_intr *powerpc_intrs[INTR_VECTORS]; static u_int nvectors; /* Allocated vectors */ static u_int stray_count; @@ -109,8 +110,17 @@ static u_int ipi_irq; device_t pic; static void +intr_init(void *dummy __unused) +{ + + mtx_init(&intr_table_lock, "intr sources lock", NULL, MTX_DEF); +} +SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL); + +static void intrcnt_setname(const char *name, int index) { + snprintf(intrnames + (MAXCOMLEN + 1) * index, MAXCOMLEN + 1, "%-*s", MAXCOMLEN, name); } @@ -122,11 +132,15 @@ intr_lookup(u_int irq) struct powerpc_intr *i, *iscan; int vector; + mtx_lock(&intr_table_lock); for (vector = 0; vector < nvectors; vector++) { i = powerpc_intrs[vector]; - if (i != NULL && i->irq == irq) + if (i != NULL && i->irq == irq) { + mtx_unlock(&intr_table_lock); return (i); + } } + mtx_unlock(&intr_table_lock); i = malloc(sizeof(*i), M_INTR, M_NOWAIT); if (i == NULL) @@ -139,8 +153,7 @@ intr_lookup(u_int irq) i->irq = irq; i->vector = -1; - /* XXX LOCK */ - + mtx_lock(&intr_table_lock); for (vector = 0; vector < INTR_VECTORS && vector <= nvectors; vector++) { iscan = powerpc_intrs[vector]; @@ -157,8 +170,7 @@ intr_lookup(u_int irq) intrcnt_setname(intrname, i->vector); nvectors++; } - - /* XXX UNLOCK */ + mtx_unlock(&intr_table_lock); if (iscan != NULL || i->vector == -1) { free(i, M_INTR); @@ -263,7 +275,10 @@ powerpc_setup_intr(const char *name, u_i error = intr_event_add_handler(i->event, name, filter, handler, arg, intr_priority(flags), flags, cookiep); + + mtx_lock(&intr_table_lock); intrcnt_setname(i->event->ie_fullname, i->vector); + mtx_unlock(&intr_table_lock); if (!cold && enable) PIC_ENABLE(pic, i->irq, i->vector); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r191362 - head/sys/powerpc/booke
On 2009-04-21, at 19:04, Marcel Moolenaar wrote: Author: marcel Date: Tue Apr 21 17:04:01 2009 New Revision: 191362 URL: http://svn.freebsd.org/changeset/base/191362 Log: o Properly set ksym_start & ksym_end when options DDB is set. Include opt_ddb.h for that. Now you can actually boot with -d and set breakpoints using function names. o Make sure to include opt_msgbuf.h. o Carve out the first 1MB of physical memory. The MPC85xx has DMA problems with addresses below 1MB. Ideally busdma knows how to avoid allocating below 1MB for MPC85xx, but that requires a bit more work. For now, ignore the 1MB of DRAM. Could you elaborate a bit on the last item? What is the faulty scenario, is this a known h/w defect documented somewhere? Rafal ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r191322 - in head/sys: arm/conf dev/iicbus
On 2009-04-21, at 20:38, M. Warner Losh wrote: In message: <20090421223502.507f0dcf.s...@freebsd.org> Stanislav Sedov writes: : -BEGIN PGP SIGNED MESSAGE- : Hash: SHA1 : : On Tue, 21 Apr 2009 12:18:05 -0600 (MDT) : "M. Warner Losh" mentioned: : : > In message: <20090421220138.f6e7b4d4.s...@freebsd.org> : > Stanislav Sedov writes: : > : -BEGIN PGP SIGNED MESSAGE- : > : Hash: SHA1 : > : : > : On Tue, 21 Apr 2009 09:25:05 -0600 (MDT) : > : "M. Warner Losh" mentioned: : > : : > : > In message: <200904201547.n3kfl6z6050...@svn.freebsd.org> : > : > Stanislav Sedov writes: : > : > : Author: stas : > : > : Date: Mon Apr 20 15:47:06 2009 : > : > : New Revision: 191322 : > : > : URL: http://svn.freebsd.org/changeset/base/191322 : > : > : : > : > : Log: : > : > : - Give a warning and start the oscillator if it was not previously : > : > : runned. : > : > : - Rename ds1672 -> rtc to follow the other drivers. : > : > : > : > This is a bad change. Please back it out. There are multiple : > : > different kinds of rtc clocks that can live on i2c. : > : > : > : : > : Why do you want to? We already have ds133x under the same name. In case : > : if there're multiple clocks in the same systems the first one will : > : have the name of rtc0, the second - rtc1 and so on. : > : > Because you'll want to support a range of boards that might have : > multiple different kinds of rtc i2c clocks. Calling them all i2c : > won't work because you can't probe the i2c bus in any meaningful way. : > the ds133x one, if it is named rtc, is wrong too. : > : : I still don't fully see your point. If you have two different RTCs : sitting on I2C bus they either have a different address, or they're : attached to different rtc busses. So you can configure them in a : usual way via hints. You don't see my point, that's right. Consider one kernel. Two different boards. Different RTC chips on each of these boards. Hints loaded from the boot loader. Now, on one board the ds1672 is used, on the other a ds163x is used. How does the right driver get attached in that case? If these boards are different, they are supposed to have different dedicated hints; doesn't this solve your concerns? Rafal ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r191375 - in head/sys/powerpc: booke include
Author: raj Date: Wed Apr 22 13:11:38 2009 New Revision: 191375 URL: http://svn.freebsd.org/changeset/base/191375 Log: Centralize setting HID0/1 for E500. Rename HID defines which are specific to E500 rather than shared within Book-E family. Obtained from:Freescale, Semihalf Modified: head/sys/powerpc/booke/locore.S head/sys/powerpc/include/hid.h Modified: head/sys/powerpc/booke/locore.S == --- head/sys/powerpc/booke/locore.S Wed Apr 22 12:52:12 2009 (r191374) +++ head/sys/powerpc/booke/locore.S Wed Apr 22 13:11:38 2009 (r191375) @@ -29,6 +29,7 @@ #include "assym.s" #include +#include #include #include #include @@ -103,6 +104,15 @@ __start: mtmsr %r3 isync + lis %r3, hid0_e500_default_...@h + ori %r3, %r3, hid0_e500_default_...@l + mtspr SPR_HID0, %r3 + isync + lis %r3, hid1_e500_default_...@h + ori %r3, %r3, hid1_e500_default_...@l + mtspr SPR_HID1, %r3 + isync + /* Invalidate all entries in TLB0 */ li %r3, 0 bl tlb_inval_all Modified: head/sys/powerpc/include/hid.h == --- head/sys/powerpc/include/hid.h Wed Apr 22 12:52:12 2009 (r191374) +++ head/sys/powerpc/include/hid.h Wed Apr 22 13:11:38 2009 (r191375) @@ -32,7 +32,7 @@ /* Hardware Implementation Dependent registers for the PowerPC */ -#define HID0_EMCP 0x8000 /* Enable MCP */ +#define HID0_EMCP 0x8000 /* Enable machine check pin */ #define HID0_DBP 0x4000 /* Disable 60x bus parity generation */ #define HID0_EBA 0x2000 /* Enable 60x bus address parity checking */ #define HID0_EBD 0x1000 /* Enable 60x bus data parity checking */ @@ -73,9 +73,9 @@ #define HID0_AIM_TBEN 0x0400 /* Time base enable (7450) */ -#define HID0_BOOKE_TBEN0x4000 /* Time Base and decr. enable */ -#define HID0_BOOKE_SEL_TBCLK 0x2000 /* Select Time Base clock */ -#define HID0_BOOKE_MAS7UPDEN 0x0080 /* Enable MAS7 update (e500v2) */ +#define HID0_E500_TBEN 0x4000 /* Time Base and decr. enable */ +#define HID0_E500_SEL_TBCLK0x2000 /* Select Time Base clock */ +#define HID0_E500_MAS7UPDEN0x0080 /* Enable MAS7 update (e500v2) */ #define HID0_BITMASK \ "\20" \ @@ -147,6 +147,13 @@ * 7457: XBSEN = Extended BAT Block Size Enable */ +#define HID1_E500_ABE 0x1000 /* Address broadcast enable */ +#define HID1_E500_ASTME0x2000 /* Address bus streaming mode enable */ +#define HID1_E500_RFXE 0x0002 /* Read fault exception enable */ + +#define HID0_E500_DEFAULT_SET (HID0_EMCP | HID0_E500_TBEN) +#define HID1_E500_DEFAULT_SET (HID1_E500_ABE | HID1_E500_ASTME) + #define HID5_970_DCBZ_SIZE_HI 0x0100 /* dcbz does a 32-byte store */ #endif /* _POWERPC_HID_H_ */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r191376 - head/sys/powerpc/booke
Author: raj Date: Wed Apr 22 13:13:34 2009 New Revision: 191376 URL: http://svn.freebsd.org/changeset/base/191376 Log: Provide cpu_throw() for Book-E. Adjust cpu_switch() towards ULE support. Obtained from:Freescale, Semihalf Modified: head/sys/powerpc/booke/swtch.S head/sys/powerpc/booke/vm_machdep.c Modified: head/sys/powerpc/booke/swtch.S == --- head/sys/powerpc/booke/swtch.S Wed Apr 22 13:11:38 2009 (r191375) +++ head/sys/powerpc/booke/swtch.S Wed Apr 22 13:13:34 2009 (r191376) @@ -69,11 +69,20 @@ #include /* - * void cpu_switch(struct thread *old, struct thread *new) + * void cpu_throw(struct thread *old, struct thread *new) + */ +ENTRY(cpu_throw) + mr %r15, %r4 + b cpu_switchin + +/* + * void cpu_switch(struct thread *old, struct thread *new, struct mutex *mtx);) * * Switch to a new thread saving the current state in the old thread. */ ENTRY(cpu_switch) + stw %r5, TD_LOCK(%r3) + lwz %r5, TD_PCB(%r3)/* Get the old thread's PCB ptr */ mr %r12, %r2 @@ -98,6 +107,7 @@ ENTRY(cpu_switch) bl pmap_deactivate /* Deactivate the current pmap */ +cpu_switchin: mr %r3, %r15 /* Get new thread ptr */ bl pmap_activate /* Activate the new address space */ Modified: head/sys/powerpc/booke/vm_machdep.c == --- head/sys/powerpc/booke/vm_machdep.c Wed Apr 22 13:11:38 2009 (r191375) +++ head/sys/powerpc/booke/vm_machdep.c Wed Apr 22 13:13:34 2009 (r191376) @@ -248,15 +248,6 @@ cpu_exit(struct thread *td) } -/* Temporary helper */ -void -cpu_throw(struct thread *old, struct thread *new) -{ - - cpu_switch(old, new, NULL); - panic("cpu_throw() didn't"); -} - /* * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-)) */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r191378 - head/sys/powerpc/booke
Author: raj Date: Wed Apr 22 13:18:04 2009 New Revision: 191378 URL: http://svn.freebsd.org/changeset/base/191378 Log: Minor style consistency fix. Modified: head/sys/powerpc/booke/swtch.S Modified: head/sys/powerpc/booke/swtch.S == --- head/sys/powerpc/booke/swtch.S Wed Apr 22 13:17:47 2009 (r191377) +++ head/sys/powerpc/booke/swtch.S Wed Apr 22 13:18:04 2009 (r191378) @@ -138,10 +138,10 @@ cpu_switchin: * Update pcb, saving current processor state */ ENTRY(savectx) - mr %r12,%r2 - stmw%r12,PCB_CONTEXT(%r3) /* Save the non-volatile GP regs */ + mr %r12, %r2 + stmw%r12, PCB_CONTEXT(%r3) /* Save the non-volatile GP regs */ mfcr%r4 /* Save the condition register */ - stw %r4,PCB_CONTEXT(%r3) + stw %r4, PCB_CONTEXT(%r3) blr /* @@ -149,11 +149,11 @@ ENTRY(savectx) * Set up the return from cpu_fork() */ ENTRY(fork_trampoline) - lwz %r3,CF_FUNC(%r1) - lwz %r4,CF_ARG0(%r1) - lwz %r5,CF_ARG1(%r1) + lwz %r3, CF_FUNC(%r1) + lwz %r4, CF_ARG0(%r1) + lwz %r5, CF_ARG1(%r1) bl fork_exit - addi%r1,%r1,CF_SIZE-FSP /* Allow 8 bytes in front of + addi%r1, %r1, CF_SIZE-FSP /* Allow 8 bytes in front of trapframe to simulate FRAME_SETUP does when allocating space for a frame pointer/saved LR */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r191380 - head/sys/powerpc/powerpc
Author: raj Date: Wed Apr 22 13:31:52 2009 New Revision: 191380 URL: http://svn.freebsd.org/changeset/base/191380 Log: Eliminate redundant setting of HID0_EMCP. Modified: head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/powerpc/cpu.c == --- head/sys/powerpc/powerpc/cpu.c Wed Apr 22 13:18:13 2009 (r191379) +++ head/sys/powerpc/powerpc/cpu.c Wed Apr 22 13:31:52 2009 (r191380) @@ -231,7 +231,6 @@ cpu_setup(u_int cpuid) case FSL_E500v1: case FSL_E500v2: - hid0 |= HID0_EMCP; break; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r191387 - head/share/man/man4/man4.powerpc
Author: raj Date: Wed Apr 22 15:25:00 2009 New Revision: 191387 URL: http://svn.freebsd.org/changeset/base/191387 Log: Provide manual page for the tsec(4) device driver. Obtained from:Semihalf Added: head/share/man/man4/man4.powerpc/tsec.4 (contents, props changed) Modified: head/share/man/man4/man4.powerpc/Makefile Modified: head/share/man/man4/man4.powerpc/Makefile == --- head/share/man/man4/man4.powerpc/Makefile Wed Apr 22 15:13:20 2009 (r191386) +++ head/share/man/man4/man4.powerpc/Makefile Wed Apr 22 15:25:00 2009 (r191387) @@ -4,7 +4,8 @@ MAN=bm.4 \ pmu.4 \ powermac_nvram.4 \ snd_ai2s.4 \ - snd_davbus.4 + snd_davbus.4 \ + tsec.4 MANSUBDIR=/powerpc Added: head/share/man/man4/man4.powerpc/tsec.4 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.powerpc/tsec.4 Wed Apr 22 15:25:00 2009 (r191387) @@ -0,0 +1,156 @@ +.\" +.\" Copyright (c) 2009 Semihalf, Rafal Jaworowski +.\" +.\" All rights reserved. +.\" +.\" 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 DEVELOPERS ``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 DEVELOPERS 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. +.\" +.\" $FreeBSD$ +.\" +.Dd April 22, 2009 +.Dt TSEC 4 +.Os +.Sh NAME +.Nm tsec +.Nd "Freescale Three-Speed Ethernet Controller device driver" +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device tsec" +.Cd "device miibus" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the gigabit Ethernet controller integrated in +some of the Freescale system-on-chip devices. +.Pp +The +.Nm +driver supports the following media types: +.Pp +.Bl -tag -width +.It autoselect +Enable autoselection of the media type and options +.It 10baseT/UTP +Set 10Mbps operation +.It 100baseTX +Set 100Mbps operation +.It 1000baseT +Set 1000baseT operation +.El +.Pp +The +.Nm +driver supports the following media options: +.Pp +.Bl -tag -width +.It full-duplex +Set full duplex operation +.El +.Pp +The +.Nm +driver supports polled operation when the system is configured with +DEVICE_POLLING kernel option, see +.Xr polling 4 +for more details. +.Pp +The +.Nm +driver supports reception and transmission of extended frames +for +.Xr vlan 4 . +This capability of +.Nm +can be controlled by means of the +.Cm vlanmtu +parameter +to +.Xr ifconfig 8 . +.Pp +The +.Nm +driver supports interrupts coalescing (IC) so that raising a transmit/receive +frame interrupt is delayed, if possible, until a threshold-defined period of +time has elapsed, or a threshold-defined frame counter has been reached +(whichever occurs first). The following sysctls regulate this behaviour: +.Bl -tag -width indent +.It Va dev.tsec.X.int_coal.rx_time +.It Va dev.tsec.X.int_coal.rx_count +.It Va dev.tsec.X.int_coal.tx_time +.It Va dev.tsec.X.int_coal.tx_count +.Pp +Value of 0 for either time or count disables IC on the given path. Time value +1-65535 corresponds to a real time period and is expressed in units equivalent +to 64 ticks of the TSEC clock. Count 1-255 represents the number of frames +(note that value of 1 is equivalent to IC disabled). User provided values +larger than supported will be trimmed to the maximum supported. More details +are available in the reference manual of the device. +.El +.Sh HARDWARE +Gigabit Ethernet controllers built into the following Free
Re: svn commit: r191450 - in head/sys: conf powerpc/conf powerpc/include powerpc/mpc85xx powerpc/powerpc
On 2009-04-24, at 05:51, Marcel Moolenaar wrote: Author: marcel Date: Fri Apr 24 03:51:11 2009 New Revision: 191450 URL: http://svn.freebsd.org/changeset/base/191450 Log: Add suppport for ISA and ISA interrupts to make the ATA controller in the VIA southbridge functional in the CDS (Configurable Development System) for MPC85XX. The embedded USB controllers look operational but the interrupt steering is still wrong. Hi Marcel, Great to see this. What is still missing around interrupts here, is it only USB-related? Does ATA controller within the VIA bridge work already? Rafal ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r191455 - head/sys/powerpc/aim
Author: raj Date: Fri Apr 24 08:57:54 2009 New Revision: 191455 URL: http://svn.freebsd.org/changeset/base/191455 Log: Zero PCB during early AIM PowerPC init. When memory is not zero'ed by firmware, uninitialized PCB can have bogus contents, which appear as a saved onfault condition, Altivec context to restore etc. and lead to corruption/crashes. This commit fixes such issues. Submitted by: Michal Mazur arg ! semihalf dot com Tested by:Andreas Tobler andreast-list ! fgznet dot ch Modified: head/sys/powerpc/aim/machdep.c Modified: head/sys/powerpc/aim/machdep.c == --- head/sys/powerpc/aim/machdep.c Fri Apr 24 06:44:58 2009 (r191454) +++ head/sys/powerpc/aim/machdep.c Fri Apr 24 08:57:54 2009 (r191455) @@ -505,6 +505,7 @@ powerpc_init(u_int startkernel, u_int en thread0.td_pcb = (struct pcb *) ((thread0.td_kstack + thread0.td_kstack_pages * PAGE_SIZE - sizeof(struct pcb)) & ~15); + bzero((void *)thread0.td_pcb, sizeof(struct pcb)); pc->pc_curpcb = thread0.td_pcb; /* Initialise the message buffer. */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r191829 - head/sys/boot/uboot/lib
Author: raj Date: Tue May 5 16:29:08 2009 New Revision: 191829 URL: http://svn.freebsd.org/changeset/base/191829 Log: GPT style partitioning for loader(8) with U-Boot support library (tested on ARM). Submitted by: Piotr Ziecik kosmo ! semihalf dot com Modified: head/sys/boot/uboot/lib/devicename.c head/sys/boot/uboot/lib/disk.c head/sys/boot/uboot/lib/libuboot.h Modified: head/sys/boot/uboot/lib/devicename.c == --- head/sys/boot/uboot/lib/devicename.cTue May 5 16:27:45 2009 (r191828) +++ head/sys/boot/uboot/lib/devicename.cTue May 5 16:29:08 2009 (r191829) @@ -90,7 +90,7 @@ uboot_parsedev(struct uboot_devdesc **de struct devsw *dv; char *cp; const char *np; - int i, unit, partition, err; + int i, unit, pnum, ptype, err; /* minimum length check */ if (strlen(devspec) < 2) @@ -116,7 +116,8 @@ uboot_parsedev(struct uboot_devdesc **de case DEVT_DISK: unit = -1; - partition = -1; + pnum = -1; + ptype = -1; if (*np && (*np != ':')) { /* next comes the unit number */ unit = strtol(np, &cp, 10); @@ -126,13 +127,20 @@ uboot_parsedev(struct uboot_devdesc **de } if (*cp && (*cp != ':')) { /* get partition */ - partition = *cp - 'a'; - if ((partition < 0) || - (partition >= MAXPARTITIONS)) { - err = EPART; - goto fail; + if (*cp == 'p' && *(cp + 1) && + *(cp + 1) != ':') { + pnum = strtol(cp + 1, &cp, 10); + ptype = PTYPE_GPT; + } else { + pnum = *cp - 'a'; + ptype = PTYPE_BSDLABEL; + if ((pnum < 0) || + (pnum >= MAXPARTITIONS)) { + err = EPART; + goto fail; + } + cp++; } - cp++; } } if (*cp && (*cp != ':')) { @@ -141,7 +149,8 @@ uboot_parsedev(struct uboot_devdesc **de } idev->d_unit = unit; - idev->d_disk.partition = partition; + idev->d_disk.pnum = pnum; + idev->d_disk.ptype = ptype; idev->d_disk.data = NULL; if (path != NULL) *path = (*cp == 0) ? cp : cp + 1; @@ -202,9 +211,15 @@ uboot_fmtdev(void *vdev) case DEVT_DISK: cp = buf; cp += sprintf(cp, "%s%d", dev->d_dev->dv_name, dev->d_unit); - if (dev->d_kind.disk.partition >= 0) - cp += sprintf(cp, "%c", dev->d_kind.disk.partition + - 'a'); + if (dev->d_kind.disk.pnum >= 0) { + if (dev->d_kind.disk.ptype == PTYPE_BSDLABEL) + cp += sprintf(cp, "%c", + dev->d_kind.disk.pnum + 'a'); + else if (dev->d_kind.disk.ptype == PTYPE_GPT) + cp += sprintf(cp, "p%i", + dev->d_kind.disk.pnum); + } + strcat(cp, ":"); break; Modified: head/sys/boot/uboot/lib/disk.c ====== --- head/sys/boot/uboot/lib/disk.c Tue May 5 16:27:45 2009 (r191828) +++ head/sys/boot/uboot/lib/disk.c Tue May 5 16:29:08 2009 (r191829) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2008 Semihalf, Rafal Jaworowski + * Copyright (c) 2009 Semihalf, Piotr Ziecik * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,6 +42,8 @@ __FBSDID("$FreeBSD$"); #define FSTYPENAMES #include +#include +#include #include "api_public.h" #include "bootstrap.h" @@ -72,9 +75,6 @@ struct gpt_part { struct open_dev { int od_bsize; /* block size */ int
Re: svn commit: r191829 - head/sys/boot/uboot/lib
On 2009-05-05, at 19:33, Marcel Moolenaar wrote: On May 5, 2009, at 9:29 AM, Rafal Jaworowski wrote: Author: raj Date: Tue May 5 16:29:08 2009 New Revision: 191829 URL: http://svn.freebsd.org/changeset/base/191829 Log: GPT style partitioning for loader(8) with U-Boot support library (tested on ARM). Alas, this is broken for big-endian machines... It's a known TODO item, but without a working BE storage environment at the moment we couldn't test this. Note the storage support in loader is only enabled for ARM at the moment (default LE). Rafal ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r254531 - head/sys/arm/arm
Author: raj Date: Mon Aug 19 14:56:17 2013 New Revision: 254531 URL: http://svnweb.freebsd.org/changeset/base/254531 Log: Simplify pv_entry removal or ARMv6/v7: - PGA_WRITEABLE indicates that there *might be* a writable mapping for the particular page, so to avoid frequent sweeping of the pv_entries whenever pmap_nuke_pv(), pmap_modify_pv(), etc. is called, it is sufficient to clear that flag if there are no managed mappings for that page anymore (notice that only pmap_enter is authorized to set this flag). - Avoid redundant checking for PVF_WIRED flag when this flag cannot be set anyway. - Clear PGA_WRITEABLE only once for each vm_page instead of multiple, redundant clearing it in loop when there are no writeable mappings to that page anymore. Submitted by: Zbigniew Bodek Reviewed by: gber Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c == --- head/sys/arm/arm/pmap-v6.c Mon Aug 19 14:42:39 2013(r254530) +++ head/sys/arm/arm/pmap-v6.c Mon Aug 19 14:56:17 2013(r254531) @@ -1072,39 +1072,22 @@ pmap_set_prot(pt_entry_t *ptep, vm_prot_ * => caller should NOT adjust pmap's wire_count * => we return the removed pve */ - -static void -pmap_nuke_pv(struct vm_page *m, pmap_t pmap, struct pv_entry *pve) -{ - - rw_assert(&pvh_global_lock, RA_WLOCKED); - PMAP_ASSERT_LOCKED(pmap); - - TAILQ_REMOVE(&m->md.pv_list, pve, pv_list); - - if (pve->pv_flags & PVF_WIRED) - --pmap->pm_stats.wired_count; - - if (pve->pv_flags & PVF_WRITE) { - TAILQ_FOREACH(pve, &m->md.pv_list, pv_list) - if (pve->pv_flags & PVF_WRITE) - break; - if (!pve) { - vm_page_aflag_clear(m, PGA_WRITEABLE); - } - } -} - static struct pv_entry * pmap_remove_pv(struct vm_page *m, pmap_t pmap, vm_offset_t va) { struct pv_entry *pve; rw_assert(&pvh_global_lock, RA_WLOCKED); + PMAP_ASSERT_LOCKED(pmap); pve = pmap_find_pv(m, pmap, va);/* find corresponding pve */ - if (pve != NULL) - pmap_nuke_pv(m, pmap, pve); + if (pve != NULL) { + TAILQ_REMOVE(&m->md.pv_list, pve, pv_list); + if (pve->pv_flags & PVF_WIRED) + --pmap->pm_stats.wired_count; + } + if (TAILQ_EMPTY(&m->md.pv_list)) + vm_page_aflag_clear(m, PGA_WRITEABLE); return(pve);/* return removed pve */ } @@ -1143,14 +1126,6 @@ pmap_modify_pv(struct vm_page *m, pmap_t else --pmap->pm_stats.wired_count; } - if ((oflags & PVF_WRITE) && !(flags & PVF_WRITE)) { - TAILQ_FOREACH(npv, &m->md.pv_list, pv_list) { - if (npv->pv_flags & PVF_WRITE) - break; - } - if (!npv) - vm_page_aflag_clear(m, PGA_WRITEABLE); - } return (oflags); } @@ -2062,7 +2037,9 @@ pmap_remove_pages(pmap_t pmap) pv_entry_count--; pmap->pm_stats.resident_count--; pc->pc_map[field] |= bitmask; - pmap_nuke_pv(m, pmap, pv); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + if (TAILQ_EMPTY(&m->md.pv_list)) + vm_page_aflag_clear(m, PGA_WRITEABLE); pmap_free_l2_bucket(pmap, l2b, 1); } } @@ -2458,7 +2435,9 @@ pmap_remove_all(vm_page_t m) PTE_SYNC(ptep); pmap_free_l2_bucket(pmap, l2b, 1); pmap->pm_stats.resident_count--; - pmap_nuke_pv(m, pmap, pv); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + if (pv->pv_flags & PVF_WIRED) + pmap->pm_stats.wired_count--; pmap_free_pv_entry(pmap, pv); PMAP_UNLOCK(pmap); } @@ -2469,6 +2448,7 @@ pmap_remove_all(vm_page_t m) else cpu_tlb_flushD(); } + vm_page_aflag_clear(m, PGA_WRITEABLE); rw_wunlock(&pvh_global_lock); } @@ -3338,7 +3318,9 @@ pmap_pv_reclaim(pmap_t locked_pmap) "va %x pte %x", va, *ptep)); *ptep = 0; PTE_SYNC(ptep); - pmap_nuke_pv(m, pmap, pv); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + if (TAILQ_EMPTY(&m->md.pv_list)) + vm_pa
svn commit: r254532 - in head/sys/arm: arm include
Author: raj Date: Mon Aug 19 15:12:36 2013 New Revision: 254532 URL: http://svnweb.freebsd.org/changeset/base/254532 Log: Clear all L2 PTE protection bits before their configuration. Revise L2_S_PROT_MASK to include all of the protection bits. Notice that clearing these bits does not always take away the corresponding permissions (for example, permission is granted when the bit is cleared). The bits are cleared but are to be set or left cleared accordingly in pmap_set_prot(), pmap_enter_locked(), etc. Clear L2_XN along with L2_S_PROT_MASK in pmap_set_prot() so that all permissions related bits are cleared before actual configuration. Submitted by: Zbigniew Bodek Reviewed by: gber Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/pmap-v6.c head/sys/arm/include/pmap.h Modified: head/sys/arm/arm/pmap-v6.c == --- head/sys/arm/arm/pmap-v6.c Mon Aug 19 14:56:17 2013(r254531) +++ head/sys/arm/arm/pmap-v6.c Mon Aug 19 15:12:36 2013(r254532) @@ -1046,7 +1046,7 @@ static void pmap_set_prot(pt_entry_t *ptep, vm_prot_t prot, uint8_t user) { - *ptep &= ~L2_S_PROT_MASK; + *ptep &= ~(L2_S_PROT_MASK | L2_XN); if (!(prot & VM_PROT_EXECUTE)) *ptep |= L2_XN; Modified: head/sys/arm/include/pmap.h == --- head/sys/arm/include/pmap.h Mon Aug 19 14:56:17 2013(r254531) +++ head/sys/arm/include/pmap.h Mon Aug 19 15:12:36 2013(r254532) @@ -390,7 +390,7 @@ extern int pmap_needs_pte_sync; #defineL2_S_PROT_U (L2_AP0(2)) /* user read */ #define L2_S_REF (L2_AP0(1)) /* reference flag */ -#defineL2_S_PROT_MASK (L2_S_PROT_U|L2_S_PROT_R) +#defineL2_S_PROT_MASK (L2_S_PROT_U|L2_S_PROT_R|L2_APX) #defineL2_S_EXECUTABLE(pte)(!(pte & L2_XN)) #defineL2_S_WRITABLE(pte) (!(pte & L2_APX)) #defineL2_S_REFERENCED(pte)(!!(pte & L2_S_REF)) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r254533 - head/sys/arm/arm
Author: raj Date: Mon Aug 19 15:36:23 2013 New Revision: 254533 URL: http://svnweb.freebsd.org/changeset/base/254533 Log: Fix ARMv6/v7 mapping's wired status. Last input argument in pmap_modify_pv() should be a mask of flags to be set. In pmap_change_wiring() however, the straight wired status was used, which does not represent valid flags (and is of type boolean). This commit fixes the issue so that wired flag is passed to pmap_modify_pv() properly. Submitted by: Zbigniew Bodek Reviewed by: gber Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c == --- head/sys/arm/arm/pmap-v6.c Mon Aug 19 15:12:36 2013(r254532) +++ head/sys/arm/arm/pmap-v6.c Mon Aug 19 15:36:23 2013(r254533) @@ -2932,7 +2932,8 @@ pmap_change_wiring(pmap_t pmap, vm_offse pte = *ptep; m = PHYS_TO_VM_PAGE(l2pte_pa(pte)); if (m != NULL) - pmap_modify_pv(m, pmap, va, PVF_WIRED, wired); + pmap_modify_pv(m, pmap, va, PVF_WIRED, + wired == TRUE ? PVF_WIRED : 0); rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r254535 - head/sys/arm/arm
Author: raj Date: Mon Aug 19 15:58:39 2013 New Revision: 254535 URL: http://svnweb.freebsd.org/changeset/base/254535 Log: Simplify and clean up pmap_clearbit() There is no need for calling vm_page_dirty() when clearing "modified" flag as it is already set for that page in pmap_fault_fixup() or pmap_enter() thanks to "modified" bit emulation. Also, there is no need for checking PTE "referenced" or "writeable" flags. If there is a request to clear a particular flag we should just do it. Submitted by: Zbigniew Bodek Reviewed by: gber Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c == --- head/sys/arm/arm/pmap-v6.c Mon Aug 19 15:51:30 2013(r254534) +++ head/sys/arm/arm/pmap-v6.c Mon Aug 19 15:58:39 2013(r254535) @@ -900,9 +900,6 @@ pmap_clearbit(struct vm_page *m, u_int m rw_wlock(&pvh_global_lock); - if (maskbits & PVF_WRITE) - maskbits |= PVF_MOD; - if (TAILQ_EMPTY(&m->md.pv_list)) { rw_wunlock(&pvh_global_lock); return (0); @@ -924,14 +921,12 @@ pmap_clearbit(struct vm_page *m, u_int m ptep = &l2b->l2b_kva[l2pte_index(va)]; npte = opte = *ptep; - if ((maskbits & (PVF_WRITE|PVF_MOD)) && L2_S_WRITABLE(opte)) { - vm_page_dirty(m); - + if (maskbits & (PVF_WRITE | PVF_MOD)) { /* make the pte read only */ npte |= L2_APX; } - if ((maskbits & PVF_REF) && L2_S_REFERENCED(opte)) { + if (maskbits & PVF_REF) { /* * Clear referenced flag in PTE so that we * will take a flag fault the next time the mapping ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r254536 - in head/sys/arm: arm include
Author: raj Date: Mon Aug 19 16:16:49 2013 New Revision: 254536 URL: http://svnweb.freebsd.org/changeset/base/254536 Log: Do not use pv_kva on ARMv6/v7 and save some space on each vm_page. It's only relevant for older ARM variants (with virtual cache). Submitted by: Zbigniew Bodek Reviewed by: gber Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/pmap-v6.c head/sys/arm/include/pmap.h Modified: head/sys/arm/arm/pmap-v6.c == --- head/sys/arm/arm/pmap-v6.c Mon Aug 19 15:58:39 2013(r254535) +++ head/sys/arm/arm/pmap-v6.c Mon Aug 19 16:16:49 2013(r254536) @@ -4365,6 +4365,6 @@ pmap_page_set_memattr(vm_page_t m, vm_me * uncacheable, being careful to sync caches and PTEs (and maybe * invalidate TLB?) for any current mapping it modifies. */ - if (m->md.pv_kva != 0 || TAILQ_FIRST(&m->md.pv_list) != NULL) + if (TAILQ_FIRST(&m->md.pv_list) != NULL) panic("Can't change memattr on page with existing mappings"); } Modified: head/sys/arm/include/pmap.h == --- head/sys/arm/include/pmap.h Mon Aug 19 15:58:39 2013(r254535) +++ head/sys/arm/include/pmap.h Mon Aug 19 16:16:49 2013(r254536) @@ -121,7 +121,9 @@ struct pv_chunk; struct md_page { int pvh_attrs; vm_memattr_t pv_memattr; +#if (ARM_MMU_V6 + ARM_MMU_V7) == 0 vm_offset_t pv_kva; /* first kernel VA mapping */ +#endif TAILQ_HEAD(,pv_entry) pv_list; }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r254913 - head/sys/arm/arm
Author: raj Date: Mon Aug 26 15:38:27 2013 New Revision: 254913 URL: http://svnweb.freebsd.org/changeset/base/254913 Log: Add missing TAILQ initializer (omitted in r250634). Submitted by: Zbigniew Bodek Reviewed by: alc Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c == --- head/sys/arm/arm/pmap-v6.c Mon Aug 26 15:34:18 2013(r254912) +++ head/sys/arm/arm/pmap-v6.c Mon Aug 26 15:38:27 2013(r254913) @@ -1143,6 +1143,7 @@ pmap_pinit0(struct pmap *pmap) bcopy(kernel_pmap, pmap, sizeof(*pmap)); bzero(&pmap->pm_mtx, sizeof(pmap->pm_mtx)); PMAP_LOCK_INIT(pmap); + TAILQ_INIT(&pmap->pm_pvchunk); } /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r254915 - head/sys/arm/include
Author: raj Date: Mon Aug 26 16:23:54 2013 New Revision: 254915 URL: http://svnweb.freebsd.org/changeset/base/254915 Log: Provide settings for superpage reservation system on ARM. This allows for enabling and configuring superpages reservation mechanism in order to allocate and populate 256 4KB base pages (for the purpose of promotion to a 1MB superpage). Submitted by: Zbigniew Bodek Reviewed by: alc Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/include/vmparam.h Modified: head/sys/arm/include/vmparam.h == --- head/sys/arm/include/vmparam.h Mon Aug 26 16:04:52 2013 (r254914) +++ head/sys/arm/include/vmparam.h Mon Aug 26 16:23:54 2013 (r254915) @@ -109,10 +109,17 @@ #defineVM_NFREEORDER 9 /* - * Disable superpage reservations. + * Enable superpage reservations: 1 level. */ #ifndefVM_NRESERVLEVEL -#defineVM_NRESERVLEVEL 0 +#defineVM_NRESERVLEVEL 1 +#endif + +/* + * Level 0 reservations consist of 256 pages. + */ +#ifndefVM_LEVEL_0_ORDER +#defineVM_LEVEL_0_ORDER8 #endif #define UPT_MAX_ADDRESSVADDR(UPTPTDI + 3, 0) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r254918 - in head/sys/arm: arm include
Author: raj Date: Mon Aug 26 17:12:30 2013 New Revision: 254918 URL: http://svnweb.freebsd.org/changeset/base/254918 Log: Introduce superpages support for ARMv6/v7. Promoting base pages to superpages can increase TLB coverage and allow for efficient use of page table entries. This development provides FreeBSD/ARM with superpages management mechanism roughly equivalent to what we have for i386 and amd64 architectures. 1. Add mechanism for automatic promotion of 4KB page mappings to 1MB section mappings (and demotion when not needed, respectively). 2. Managed and non-kernel mappings are now superpages-aware. 3. The functionality can be enabled by setting "vm.pmap.sp_enabled" tunable to a non-zero value (either in loader.conf or by modifying "sp_enabled" variable in pmap-v6.c file). By default, automatic promotion is currently disabled. Submitted by: Zbigniew Bodek Reviewed by: alc Sponsored by: The FreeBSD Foundation, Semihalf Modified: head/sys/arm/arm/pmap-v6.c head/sys/arm/include/param.h head/sys/arm/include/pmap.h head/sys/arm/include/pte.h Modified: head/sys/arm/arm/pmap-v6.c == --- head/sys/arm/arm/pmap-v6.c Mon Aug 26 16:38:40 2013(r254917) +++ head/sys/arm/arm/pmap-v6.c Mon Aug 26 17:12:30 2013(r254918) @@ -171,6 +171,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -201,6 +202,8 @@ int pmap_debug_level = 0; #define PV_STAT(x) do { } while (0) #endif +#definepa_to_pvh(pa) (&pv_table[pa_index(pa)]) + #ifdef ARM_L2_PIPT #define pmap_l2cache_wbinv_range(va, pa, size) cpu_l2cache_wbinv_range((pa), (size)) #define pmap_l2cache_inv_range(va, pa, size) cpu_l2cache_inv_range((pa), (size)) @@ -215,10 +218,16 @@ extern struct pv_addr systempage; * Internal function prototypes */ +static PMAP_INLINE +struct pv_entry*pmap_find_pv(struct md_page *, pmap_t, vm_offset_t); static voidpmap_free_pv_chunk(struct pv_chunk *pc); static voidpmap_free_pv_entry(pmap_t pmap, pv_entry_t pv); static pv_entry_t pmap_get_pv_entry(pmap_t pmap, boolean_t try); static vm_page_t pmap_pv_reclaim(pmap_t locked_pmap); +static boolean_t pmap_pv_insert_section(pmap_t, vm_offset_t, +vm_paddr_t); +static struct pv_entry *pmap_remove_pv(struct vm_page *, pmap_t, vm_offset_t); +static int pmap_pvh_wired_mappings(struct md_page *, int); static voidpmap_enter_locked(pmap_t, vm_offset_t, vm_prot_t, vm_page_t, vm_prot_t, boolean_t, int); @@ -226,6 +235,14 @@ static vm_paddr_t pmap_extract_locked(pm static voidpmap_alloc_l1(pmap_t); static voidpmap_free_l1(pmap_t); +static voidpmap_map_section(pmap_t, vm_offset_t, vm_offset_t, +vm_prot_t, boolean_t); +static voidpmap_promote_section(pmap_t, vm_offset_t); +static boolean_t pmap_demote_section(pmap_t, vm_offset_t); +static boolean_t pmap_enter_section(pmap_t, vm_offset_t, vm_page_t, +vm_prot_t); +static voidpmap_remove_section(pmap_t, vm_offset_t); + static int pmap_clearbit(struct vm_page *, u_int); static struct l2_bucket *pmap_get_l2_bucket(pmap_t, vm_offset_t); @@ -403,6 +420,7 @@ int pmap_needs_pte_sync; */ static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks); static int pv_entry_count, pv_entry_max, pv_entry_high_water; +static struct md_page *pv_table; static int shpgperproc = PMAP_SHPGPERPROC; struct pv_chunk *pv_chunkbase; /* KVA block for pv_chunks */ @@ -433,6 +451,11 @@ static const uint32_t pc_freemask[_NPCM] static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); +/* Superpages utilization enabled = 1 / disabled = 0 */ +static int sp_enabled = 0; +SYSCTL_INT(_vm_pmap, OID_AUTO, sp_enabled, CTLFLAG_RDTUN, &sp_enabled, 0, +"Are large page mappings enabled?"); + SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_count, CTLFLAG_RD, &pv_entry_count, 0, "Current number of pv entries"); @@ -891,7 +914,9 @@ static int pmap_clearbit(struct vm_page *m, u_int maskbits) { struct l2_bucket *l2b; - struct pv_entry *pv; + struct pv_entry *pv, *pve, *next_pv; + struct md_page *pvh; + pd_entry_t *pl1pd; pt_entry_t *ptep, npte, opte; pmap_t pmap; vm_offset_t va; @@ -899,7 +924,79 @@ pmap_clearbit(struct vm_page *m, u_int m int count = 0; rw_wlock(&pvh_global_lock); + if ((m->flags & PG_FICTITIOUS) != 0) + goto small_mappings; + pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + TAILQ_FOREACH_SAFE(pv, &pvh->pv_list, pv_list, next_pv) { + va = pv->pv_va; + pmap = PV_PMAP(pv); + PMAP_LOCK(pmap); + pl1pd = &pmap->pm_l1->l1_kva[L1_IDX(va)]; +
svn commit: r232508 - in stable/9/sys: arm/arm arm/include i386/conf
Author: raj Date: Sun Mar 4 17:00:46 2012 New Revision: 232508 URL: http://svn.freebsd.org/changeset/base/232508 Log: MFC r228504, r228530. r228504: Make *intr{cnt,names} on ARM reside in data section, similar to other arches. sintrnames and sintrcnt are initialized with non-zero values, which were discarded by the .bss directive, so consumers like "vmstat -i" were not getting correct data. Submitted by:Lukasz Plachno Obtained from: Semihalf r228530: ARM pmap fixes: - Write Buffers have to be drained after write to Page Table even if caches are in write-through mode. - Make sure to sync PTE in pmap_zero_page_generic(). Submitted by:Michal Mazur Reviewed by: cognet Obtained from: Semihalf Modified: stable/9/sys/arm/arm/irq_dispatch.S stable/9/sys/arm/arm/pmap.c stable/9/sys/arm/include/pmap.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/arm/arm/irq_dispatch.S == --- stable/9/sys/arm/arm/irq_dispatch.S Sun Mar 4 16:59:45 2012 (r232507) +++ stable/9/sys/arm/arm/irq_dispatch.S Sun Mar 4 17:00:46 2012 (r232508) @@ -98,10 +98,9 @@ ASENTRY_NP(irq_entry) PULLFRAMEFROMSVCANDEXIT movspc, lr /* Exit */ - .bss + .data .align 0 - .global _C_LABEL(intrnames), _C_LABEL(sintrnames) .global _C_LABEL(intrcnt), _C_LABEL(sintrcnt) _C_LABEL(intrnames): Modified: stable/9/sys/arm/arm/pmap.c == --- stable/9/sys/arm/arm/pmap.c Sun Mar 4 16:59:45 2012(r232507) +++ stable/9/sys/arm/arm/pmap.c Sun Mar 4 17:00:46 2012(r232508) @@ -4044,6 +4044,7 @@ pmap_zero_page_generic(vm_paddr_t phys, * order to work without corruption when write-allocate is enabled. */ *cdst_pte = L2_S_PROTO | phys | L2_S_PROT(PTE_KERNEL, VM_PROT_WRITE); + PTE_SYNC(cdst_pte); cpu_tlb_flushD_SE(cdstp); cpu_cpwait(); if (off || size != PAGE_SIZE) Modified: stable/9/sys/arm/include/pmap.h == --- stable/9/sys/arm/include/pmap.h Sun Mar 4 16:59:45 2012 (r232507) +++ stable/9/sys/arm/include/pmap.h Sun Mar 4 17:00:46 2012 (r232508) @@ -382,7 +382,8 @@ do { \ if (PMAP_NEEDS_PTE_SYNC) { \ cpu_dcache_wb_range((vm_offset_t)(pte), sizeof(pt_entry_t));\ cpu_l2cache_wb_range((vm_offset_t)(pte), sizeof(pt_entry_t));\ - }\ + } else \ + cpu_drain_writebuf(); \ } while (/*CONSTCOND*/0) #definePTE_SYNC_RANGE(pte, cnt) \ @@ -392,7 +393,8 @@ do { \ (cnt) << 2); /* * sizeof(pt_entry_t) */ \ cpu_l2cache_wb_range((vm_offset_t)(pte),\ (cnt) << 2); /* * sizeof(pt_entry_t) */ \ - } \ + } else \ + cpu_drain_writebuf(); \ } while (/*CONSTCOND*/0) extern pt_entry_t pte_l1_s_cache_mode; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r232511 - in stable/9/sys: dev/mvs i386/conf
Author: raj Date: Sun Mar 4 17:53:40 2012 New Revision: 232511 URL: http://svn.freebsd.org/changeset/base/232511 Log: MFC r230865: Adjust mvs(4) to handle interrupt cause reg depending on the actual number of channels available - current code treats bits 4:7 in 'SATAHC interrupt mask' and 'SATAHC interrupt cause' as flags for SATA channels 2 and 3 - for embedded SATA controllers (SoC) these bits have been marked as reserved in datasheets so far, but for some new and upcoming chips they are used for purposes other than SATA Submitted by:Lukasz Plachno Reviewed by: mav Obtained from: Semihalf Modified: stable/9/sys/dev/mvs/mvs.h stable/9/sys/dev/mvs/mvs_soc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/dev/mvs/mvs.h == --- stable/9/sys/dev/mvs/mvs.h Sun Mar 4 17:33:22 2012(r232510) +++ stable/9/sys/dev/mvs/mvs.h Sun Mar 4 17:53:40 2012(r232511) @@ -61,6 +61,9 @@ #define CHIP_SOC_LED 0x2C/* SoC LED Configuration */ +/* Additional mask for SoC devices with less than 4 channels */ +#define CHIP_SOC_HC0_MASK(num) (0xff >> ((4 - (num)) * 2)) + /* Chip CCC registers */ #define CHIP_ICC 0x18008 #define CHIP_ICC_ALL_PORTS (1 << 4) /* all ports irq event */ Modified: stable/9/sys/dev/mvs/mvs_soc.c == --- stable/9/sys/dev/mvs/mvs_soc.c Sun Mar 4 17:33:22 2012 (r232510) +++ stable/9/sys/dev/mvs/mvs_soc.c Sun Mar 4 17:53:40 2012 (r232511) @@ -216,7 +216,9 @@ mvs_ctlr_setup(device_t dev) if (ccc) ccim |= IC_HC0_COAL_DONE; /* Enable chip interrupts */ - ctlr->gmim = (ccc ? IC_HC0_COAL_DONE : IC_DONE_HC0) | IC_ERR_HC0; + ctlr->gmim = ((ccc ? IC_HC0_COAL_DONE : + (IC_DONE_HC0 & CHIP_SOC_HC0_MASK(ctlr->channels))) | + (IC_ERR_HC0 & CHIP_SOC_HC0_MASK(ctlr->channels))); ATA_OUTL(ctlr->r_mem, CHIP_SOC_MIM, ctlr->gmim | ctlr->pmim); return (0); } @@ -291,25 +293,26 @@ mvs_intr(void *data) struct mvs_controller *ctlr = data; struct mvs_intr_arg arg; void (*function)(void *); - int p; + int p, chan_num; u_int32_t ic, aic; ic = ATA_INL(ctlr->r_mem, CHIP_SOC_MIC); if ((ic & IC_HC0) == 0) return; + /* Acknowledge interrupts of this HC. */ aic = 0; - if (ic & (IC_DONE_IRQ << 0)) - aic |= HC_IC_DONE(0) | HC_IC_DEV(0); - if (ic & (IC_DONE_IRQ << 2)) - aic |= HC_IC_DONE(1) | HC_IC_DEV(1); - if (ic & (IC_DONE_IRQ << 4)) - aic |= HC_IC_DONE(2) | HC_IC_DEV(2); - if (ic & (IC_DONE_IRQ << 6)) - aic |= HC_IC_DONE(3) | HC_IC_DEV(3); + + /* Processing interrupts from each initialized channel */ + for (chan_num = 0; chan_num < ctlr->channels; chan_num++) { + if (ic & (IC_DONE_IRQ << (chan_num * 2))) + aic |= HC_IC_DONE(chan_num) | HC_IC_DEV(chan_num); + } + if (ic & IC_HC0_COAL_DONE) aic |= HC_IC_COAL; ATA_OUTL(ctlr->r_mem, HC_IC, ~aic); + /* Call per-port interrupt handler. */ for (p = 0; p < ctlr->channels; p++) { arg.cause = ic & (IC_ERR_IRQ|IC_DONE_IRQ); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r232512 - head/sys/arm/mv
Author: raj Date: Sun Mar 4 18:13:45 2012 New Revision: 232512 URL: http://svn.freebsd.org/changeset/base/232512 Log: Remove unused #defines. All this is now retrieved from the device tree. MFC after:1 week Modified: head/sys/arm/mv/mvreg.h Modified: head/sys/arm/mv/mvreg.h == --- head/sys/arm/mv/mvreg.h Sun Mar 4 17:53:40 2012(r232511) +++ head/sys/arm/mv/mvreg.h Sun Mar 4 18:13:45 2012(r232512) @@ -34,132 +34,6 @@ #ifndef _MVREG_H_ #define _MVREG_H_ -/* - * Interrupt sources - */ -#if defined(SOC_MV_ORION) - -#define MV_INT_BRIDGE 0 /* AHB-MBus Bridge Interrupt */ -#define MV_INT_UART0 3 /* UART0 Interrupt */ -#define MV_INT_UART1 4 -#define MV_INT_GPIO7_0 6 /* GPIO[7:0] Interrupt */ -#define MV_INT_GPIO15_87 /* GPIO[15:8] Interrupt */ -#define MV_INT_GPIO23_16 8 /* GPIO[23:16] Interrupt */ -#define MV_INT_GPIO31_24 9 /* GPIO[31:24] Interrupt */ -#define MV_INT_PEX0_ERR10 /* PCI Express Error */ -#define MV_INT_PEX011 /* PCI Express INTA,B,C,D Message */ -#define MV_INT_PCI_ERR 15 /* PCI Error */ -#define MV_INT_USB_BERR16 /* USB Bridge Error */ -#define MV_INT_USB_CI 17 /* USB Controller interrupt */ -#define MV_INT_GBERX 18 /* GbE receive interrupt */ -#define MV_INT_GBETX 19 /* GbE transmit interrupt */ -#define MV_INT_GBEMISC 20 /* GbE misc. interrupt */ -#define MV_INT_GBESUM 21 /* GbE summary interrupt */ -#define MV_INT_GBEERR 22 /* GbE error interrupt */ -#define MV_INT_IDMA_ERR23 /* DMA error interrupt */ -#define MV_INT_IDMA0 24 /* IDMA chan. 0 completion interrupt */ -#define MV_INT_IDMA1 25 /* IDMA chan. 1 completion interrupt */ -#define MV_INT_IDMA2 26 /* IDMA chan. 2 completion interrupt */ -#define MV_INT_IDMA3 27 /* IDMA chan. 3 completion interrupt */ -#define MV_INT_SATA29 /* Serial-ATA Interrupt */ - -#elif defined(SOC_MV_KIRKWOOD) - -#define MV_INT_BRIDGE 1 /* AHB-MBus Bridge Interrupt */ -#define MV_INT_XOR0_CHAN0 5 /* XOR engine 0 channel 0 Interrupt */ -#define MV_INT_XOR0_CHAN1 6 /* XOR engine 0 channel 1 Interrupt */ -#define MV_INT_XOR1_CHAN0 7 /* XOR engine 1 channel 0 Interrupt */ -#define MV_INT_XOR1_CHAN1 8 /* XOR engine 1 channel 1 Interrupt */ -#define MV_INT_PEX09 /* PCI Express INTA,B,C,D Message */ -#define MV_INT_GBESUM 11 /* GbE0 summary interrupt */ -#define MV_INT_GBERX 12 /* GbE0 receive interrupt */ -#define MV_INT_GBETX 13 /* GbE0 transmit interrupt */ -#define MV_INT_GBEMISC 14 /* GbE0 misc. interrupt */ -#define MV_INT_GBE1SUM 15 /* GbE1 summary interrupt */ -#define MV_INT_GBE1RX 16 /* GbE1 receive interrupt */ -#define MV_INT_GBE1TX 17 /* GbE1 transmit interrupt */ -#define MV_INT_GBE1MISC18 /* GbE1 misc. interrupt */ -#define MV_INT_USB_CI 19 /* USB Controller interrupt */ -#define MV_INT_SATA21 /* Serial-ATA Interrupt */ -#define MV_INT_CESA22 /* Security engine completion int. */ -#define MV_INT_IDMA_ERR23 /* DMA error interrupt */ -#define MV_INT_UART0 33 /* UART0 Interrupt */ -#define MV_INT_UART1 34 -#define MV_INT_GPIO7_0 35 /* GPIO[7:0] Interrupt */ -#define MV_INT_GPIO15_836 /* GPIO[15:8] Interrupt */ -#define MV_INT_GPIO23_16 37 /* GPIO[23:16] Interrupt */ -#define MV_INT_GPIO31_24 38 /* GPIO[31:24] Interrupt */ -#define MV_INT_GPIOHI7_0 39 /* GPIOHI[7:0] Interrupt */ -#define MV_INT_GPIOHI15_8 40 /* GPIOHI[15:8] Interrupt */ -#define MV_INT_GPIOHI23_16 41 /* GPIOHI[23:16] Interrupt */ -#define MV_INT_XOR0_ERR42 /* XOR engine 0 error Interrupt */ -#define MV_INT_XOR1_ERR43 /* XOR engine 1 error Interrupt */ -#define MV_INT_PEX0_ERR44 /* PCI Express Error */ -#define MV_INT_GBEERR 46 /* GbE0 error interrupt */ -#define MV_INT_GBE1ERR 47 /* GbE1 error interrupt */ -#define MV_INT_USB_BERR48 /* USB Bridge Error */ - -#elif defined(SOC_MV_DISCOVERY) - -#define MV_INT_ERRSUM 0 /* Summary of error interrupts */ -#define MV_INT_SPI 1 /* SPI interrupt */ -#define MV_INT_TWSI0 2 /* TWSI0 interrupt */ -#define MV_INT_TWSI1 3 /* TWSI1 interrupt */ -#define MV_INT_IDMA0 4 /* IDMA Channel0 completion */ -#define MV_INT_IDMA1
svn commit: r232518 - in head/sys: boot/fdt/dts dev/fdt dev/mge dev/tsec
Author: raj Date: Sun Mar 4 19:22:52 2012 New Revision: 232518 URL: http://svn.freebsd.org/changeset/base/232518 Log: Respect phy-handle property in Ethernet nodes of the device tree. This lets specify whereabouts of the parent PHY for a given MAC node (and get rid of ugly kludges in mge(4) and tsec(4)). Obtained from:Semihalf MFC after:1 week Modified: head/sys/boot/fdt/dts/db78100.dts head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/fdt_common.h head/sys/dev/mge/if_mge.c head/sys/dev/mge/if_mgevar.h head/sys/dev/tsec/if_tsec.c head/sys/dev/tsec/if_tsec.h head/sys/dev/tsec/if_tsec_fdt.c Modified: head/sys/boot/fdt/dts/db78100.dts == --- head/sys/boot/fdt/dts/db78100.dts Sun Mar 4 18:59:38 2012 (r232517) +++ head/sys/boot/fdt/dts/db78100.dts Sun Mar 4 19:22:52 2012 (r232518) @@ -221,6 +221,9 @@ phy0: ethernet-phy@0 { reg = <0x8>; }; + phy1: ethernet-phy@1 { + reg = <0x9>; + }; }; }; @@ -234,17 +237,7 @@ local-mac-address = [ 00 00 00 00 00 00 ]; interrupts = <45 46 47 44 70>; interrupt-parent = <&PIC>; - phy-handle = <&phy0>; - - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,mdio"; - - phy0: ethernet-phy@0 { - reg = <0x9>; - }; - }; + phy-handle = <&phy1>; }; serial0: serial@12000 { Modified: head/sys/dev/fdt/fdt_common.c == --- head/sys/dev/fdt/fdt_common.c Sun Mar 4 18:59:38 2012 (r232517) +++ head/sys/dev/fdt/fdt_common.c Sun Mar 4 19:22:52 2012 (r232518) @@ -542,11 +542,13 @@ out: } int -fdt_get_phyaddr(phandle_t node, int *phy_addr) +fdt_get_phyaddr(phandle_t node, device_t dev, int *phy_addr, void **phy_sc) { phandle_t phy_node; ihandle_t phy_ihandle; pcell_t phy_handle, phy_reg; + uint32_t i; + device_t parent, child; if (OF_getprop(node, "phy-handle", (void *)&phy_handle, sizeof(phy_handle)) <= 0) @@ -561,6 +563,47 @@ fdt_get_phyaddr(phandle_t node, int *phy return (ENXIO); *phy_addr = fdt32_to_cpu(phy_reg); + + /* +* Search for softc used to communicate with phy. +*/ + + /* +* Step 1: Search for ancestor of the phy-node with a "phy-handle" +* property set. +*/ + phy_node = OF_parent(phy_node); + while (phy_node != 0) { + if (OF_getprop(phy_node, "phy-handle", (void *)&phy_handle, + sizeof(phy_handle)) > 0) + break; + phy_node = OF_parent(phy_node); + } + if (phy_node == 0) + return (ENXIO); + + /* +* Step 2: For each device with the same parent and name as ours +* compare its node with the one found in step 1, ancestor of phy +* node (stored in phy_node). +*/ + parent = device_get_parent(dev); + i = 0; + child = device_find_child(parent, device_get_name(dev), i); + while (child != NULL) { + if (ofw_bus_get_node(child) == phy_node) + break; + i++; + child = device_find_child(parent, device_get_name(dev), i); + } + if (child == NULL) + return (ENXIO); + + /* +* Use softc of the device found. +*/ + *phy_sc = (void *)device_get_softc(child); + return (0); } Modified: head/sys/dev/fdt/fdt_common.h == --- head/sys/dev/fdt/fdt_common.h Sun Mar 4 18:59:38 2012 (r232517) +++ head/sys/dev/fdt/fdt_common.h Sun Mar 4 19:22:52 2012 (r232518) @@ -89,7 +89,7 @@ int fdt_data_to_res(pcell_t *, int, int, int fdt_data_verify(void *, int); phandle_t fdt_find_compatible(phandle_t, const char *, int); int fdt_get_mem_regions(struct mem_region *, int *, uint32_t *); -int fdt_get_phyaddr(phandle_t node, int *); +int fdt_get_phyaddr(phandle_t, device_t, int *, void **); int fdt_immr_addr(vm_offset_t); int fdt_regsize(phandle_t, u_long *, u_long *); int fdt_intr_decode(phandle_t, pcell_t *, int *, int *, int *); Modified: head/sys/dev/mge/if_mge.c ==
svn commit: r233013 - head/sys/arm/mv
Author: raj Date: Thu Mar 15 21:48:27 2012 New Revision: 233013 URL: http://svn.freebsd.org/changeset/base/233013 Log: Fix error check. Submitted by: Lukasz Plachno Obtained from:Semihalf Modified: head/sys/arm/mv/common.c Modified: head/sys/arm/mv/common.c == --- head/sys/arm/mv/common.cThu Mar 15 21:19:50 2012(r233012) +++ head/sys/arm/mv/common.cThu Mar 15 21:48:27 2012(r233013) @@ -1766,7 +1766,7 @@ win_cpu_from_dt(void) if (fdt_is_compatible(node, "mrvl,cesa-sram")) goto moveon; - if ((node = OF_finddevice("/")) != -1) + if ((node = OF_finddevice("/")) == -1) return (ENXIO); if ((node = fdt_find_compatible(node, "mrvl,cesa-sram", 0)) == 0) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r233014 - in stable/9/sys: arm/mv i386/conf
Author: raj Date: Thu Mar 15 22:08:25 2012 New Revision: 233014 URL: http://svn.freebsd.org/changeset/base/233014 Log: MFC r232512: Remove unused #defines. All this is now retrieved from the device tree. Modified: stable/9/sys/arm/mv/mvreg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/arm/mv/mvreg.h == --- stable/9/sys/arm/mv/mvreg.h Thu Mar 15 21:48:27 2012(r233013) +++ stable/9/sys/arm/mv/mvreg.h Thu Mar 15 22:08:25 2012(r233014) @@ -34,132 +34,6 @@ #ifndef _MVREG_H_ #define _MVREG_H_ -/* - * Interrupt sources - */ -#if defined(SOC_MV_ORION) - -#define MV_INT_BRIDGE 0 /* AHB-MBus Bridge Interrupt */ -#define MV_INT_UART0 3 /* UART0 Interrupt */ -#define MV_INT_UART1 4 -#define MV_INT_GPIO7_0 6 /* GPIO[7:0] Interrupt */ -#define MV_INT_GPIO15_87 /* GPIO[15:8] Interrupt */ -#define MV_INT_GPIO23_16 8 /* GPIO[23:16] Interrupt */ -#define MV_INT_GPIO31_24 9 /* GPIO[31:24] Interrupt */ -#define MV_INT_PEX0_ERR10 /* PCI Express Error */ -#define MV_INT_PEX011 /* PCI Express INTA,B,C,D Message */ -#define MV_INT_PCI_ERR 15 /* PCI Error */ -#define MV_INT_USB_BERR16 /* USB Bridge Error */ -#define MV_INT_USB_CI 17 /* USB Controller interrupt */ -#define MV_INT_GBERX 18 /* GbE receive interrupt */ -#define MV_INT_GBETX 19 /* GbE transmit interrupt */ -#define MV_INT_GBEMISC 20 /* GbE misc. interrupt */ -#define MV_INT_GBESUM 21 /* GbE summary interrupt */ -#define MV_INT_GBEERR 22 /* GbE error interrupt */ -#define MV_INT_IDMA_ERR23 /* DMA error interrupt */ -#define MV_INT_IDMA0 24 /* IDMA chan. 0 completion interrupt */ -#define MV_INT_IDMA1 25 /* IDMA chan. 1 completion interrupt */ -#define MV_INT_IDMA2 26 /* IDMA chan. 2 completion interrupt */ -#define MV_INT_IDMA3 27 /* IDMA chan. 3 completion interrupt */ -#define MV_INT_SATA29 /* Serial-ATA Interrupt */ - -#elif defined(SOC_MV_KIRKWOOD) - -#define MV_INT_BRIDGE 1 /* AHB-MBus Bridge Interrupt */ -#define MV_INT_XOR0_CHAN0 5 /* XOR engine 0 channel 0 Interrupt */ -#define MV_INT_XOR0_CHAN1 6 /* XOR engine 0 channel 1 Interrupt */ -#define MV_INT_XOR1_CHAN0 7 /* XOR engine 1 channel 0 Interrupt */ -#define MV_INT_XOR1_CHAN1 8 /* XOR engine 1 channel 1 Interrupt */ -#define MV_INT_PEX09 /* PCI Express INTA,B,C,D Message */ -#define MV_INT_GBESUM 11 /* GbE0 summary interrupt */ -#define MV_INT_GBERX 12 /* GbE0 receive interrupt */ -#define MV_INT_GBETX 13 /* GbE0 transmit interrupt */ -#define MV_INT_GBEMISC 14 /* GbE0 misc. interrupt */ -#define MV_INT_GBE1SUM 15 /* GbE1 summary interrupt */ -#define MV_INT_GBE1RX 16 /* GbE1 receive interrupt */ -#define MV_INT_GBE1TX 17 /* GbE1 transmit interrupt */ -#define MV_INT_GBE1MISC18 /* GbE1 misc. interrupt */ -#define MV_INT_USB_CI 19 /* USB Controller interrupt */ -#define MV_INT_SATA21 /* Serial-ATA Interrupt */ -#define MV_INT_CESA22 /* Security engine completion int. */ -#define MV_INT_IDMA_ERR23 /* DMA error interrupt */ -#define MV_INT_UART0 33 /* UART0 Interrupt */ -#define MV_INT_UART1 34 -#define MV_INT_GPIO7_0 35 /* GPIO[7:0] Interrupt */ -#define MV_INT_GPIO15_836 /* GPIO[15:8] Interrupt */ -#define MV_INT_GPIO23_16 37 /* GPIO[23:16] Interrupt */ -#define MV_INT_GPIO31_24 38 /* GPIO[31:24] Interrupt */ -#define MV_INT_GPIOHI7_0 39 /* GPIOHI[7:0] Interrupt */ -#define MV_INT_GPIOHI15_8 40 /* GPIOHI[15:8] Interrupt */ -#define MV_INT_GPIOHI23_16 41 /* GPIOHI[23:16] Interrupt */ -#define MV_INT_XOR0_ERR42 /*
svn commit: r233015 - in stable/9/sys: boot/fdt/dts dev/fdt dev/mge dev/tsec i386/conf
Author: raj Date: Thu Mar 15 22:15:06 2012 New Revision: 233015 URL: http://svn.freebsd.org/changeset/base/233015 Log: MFC r232518: Respect phy-handle property in Ethernet nodes of the device tree. This lets specify whereabouts of the parent PHY for a given MAC node (and get rid of ugly kludges in mge(4) and tsec(4)). Obtained from:Semihalf Modified: stable/9/sys/boot/fdt/dts/db78100.dts stable/9/sys/dev/fdt/fdt_common.c stable/9/sys/dev/fdt/fdt_common.h stable/9/sys/dev/mge/if_mge.c stable/9/sys/dev/mge/if_mgevar.h stable/9/sys/dev/tsec/if_tsec.c stable/9/sys/dev/tsec/if_tsec.h stable/9/sys/dev/tsec/if_tsec_fdt.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/boot/fdt/dts/db78100.dts == --- stable/9/sys/boot/fdt/dts/db78100.dts Thu Mar 15 22:08:25 2012 (r233014) +++ stable/9/sys/boot/fdt/dts/db78100.dts Thu Mar 15 22:15:06 2012 (r233015) @@ -221,6 +221,9 @@ phy0: ethernet-phy@0 { reg = <0x8>; }; + phy1: ethernet-phy@1 { + reg = <0x9>; + }; }; }; @@ -234,17 +237,7 @@ local-mac-address = [ 00 00 00 00 00 00 ]; interrupts = <45 46 47 44 70>; interrupt-parent = <&PIC>; - phy-handle = <&phy0>; - - mdio@0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "mrvl,mdio"; - - phy0: ethernet-phy@0 { - reg = <0x9>; - }; - }; + phy-handle = <&phy1>; }; serial0: serial@12000 { Modified: stable/9/sys/dev/fdt/fdt_common.c == --- stable/9/sys/dev/fdt/fdt_common.c Thu Mar 15 22:08:25 2012 (r233014) +++ stable/9/sys/dev/fdt/fdt_common.c Thu Mar 15 22:15:06 2012 (r233015) @@ -542,11 +542,13 @@ out: } int -fdt_get_phyaddr(phandle_t node, int *phy_addr) +fdt_get_phyaddr(phandle_t node, device_t dev, int *phy_addr, void **phy_sc) { phandle_t phy_node; ihandle_t phy_ihandle; pcell_t phy_handle, phy_reg; + uint32_t i; + device_t parent, child; if (OF_getprop(node, "phy-handle", (void *)&phy_handle, sizeof(phy_handle)) <= 0) @@ -561,6 +563,47 @@ fdt_get_phyaddr(phandle_t node, int *phy return (ENXIO); *phy_addr = fdt32_to_cpu(phy_reg); + + /* +* Search for softc used to communicate with phy. +*/ + + /* +* Step 1: Search for ancestor of the phy-node with a "phy-handle" +* property set. +*/ + phy_node = OF_parent(phy_node); + while (phy_node != 0) { + if (OF_getprop(phy_node, "phy-handle", (void *)&phy_handle, + sizeof(phy_handle)) > 0) + break; + phy_node = OF_parent(phy_node); + } + if (phy_node == 0) + return (ENXIO); + + /* +* Step 2: For each device with the same parent and name as ours +* compare its node with the one found in step 1, ancestor of phy +* node (stored in phy_node). +*/ + parent = device_get_parent(dev); + i = 0; + child = device_find_child(parent, device_get_name(dev), i); + while (child != NULL) { + if (ofw_bus_get_node(child) == phy_node) + break; + i++; + child = device_find_child(parent, device_get_name(dev), i); + } + if (child == NULL) + return (ENXIO); + + /* +* Use softc of the device found. +*/ + *phy_sc = (void *)device_get_softc(child); + return (0); }
svn commit: r233230 - in head/sys/boot: fdt uboot/common
Author: raj Date: Tue Mar 20 13:08:57 2012 New Revision: 233230 URL: http://svn.freebsd.org/changeset/base/233230 Log: Improve device tree blob (DTB) handling in loader(8). Enable using the statically embedded blob from the kernel, if present. The KLD loaded DTB takes precedence, but they are both recognized and handled in the same way. Submitted by: Lukasz Wojcik Obtained from:Semihalf MFC after:1 week Modified: head/sys/boot/fdt/fdt_loader_cmd.c head/sys/boot/uboot/common/metadata.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c == --- head/sys/boot/fdt/fdt_loader_cmd.c Tue Mar 20 12:24:36 2012 (r233229) +++ head/sys/boot/fdt/fdt_loader_cmd.c Tue Mar 20 13:08:57 2012 (r233230) @@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include "bootstrap.h" #include "glue.h" @@ -56,6 +59,10 @@ __FBSDID("$FreeBSD$"); #define MIN(num1, num2)(((num1) < (num2)) ? (num1):(num2)) +#define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l) + +#define FDT_STATIC_DTB_SYMBOL "fdt_static_dtb" + static struct fdt_header *fdtp = NULL; static int fdt_cmd_nyi(int argc, char *argv[]); @@ -92,6 +99,86 @@ static const struct cmdtab commands[] = static char cwd[FDT_CWD_LEN] = "/"; +static vm_offset_t +fdt_find_static_dtb(void) +{ + Elf_Sym sym; + vm_offset_t dyntab, esym; + uint64_t offs; + struct preloaded_file *kfp; + struct file_metadata *md; + Elf_Sym *symtab; + Elf_Dyn *dyn; + char *strtab, *strp; + int i; + + esym = strtab = symtab = 0; + + offs = __elfN(relocation_offset); + + kfp = file_findfile(NULL, NULL); + if (kfp == NULL) + return (0); + + md = file_findmetadata(kfp, MODINFOMD_ESYM); + if (md == NULL) + return (0); + COPYOUT(md->md_data, &esym, sizeof(esym)); + + md = file_findmetadata(kfp, MODINFOMD_DYNAMIC); + if (md == NULL) + return (0); + COPYOUT(md->md_data, &dyntab, sizeof(dyntab)); + dyntab += offs; + + /* Locate STRTAB and DYNTAB */ + for (dyn = (Elf_Dyn *)dyntab; dyn->d_tag != DT_NULL; dyn++) { + if (dyn->d_tag == DT_STRTAB) { + strtab = (char *)(uintptr_t)(dyn->d_un.d_ptr + offs); + continue; + } else if (dyn->d_tag == DT_SYMTAB) { + symtab = (Elf_Sym *)(uintptr_t) + (dyn->d_un.d_ptr + offs); + continue; + } + } + + if (symtab == NULL || strtab == NULL) { + /* +* No symtab? No strtab? That should not happen here, +* and should have been verified during __elfN(loadimage). +* This must be some kind of a bug. +*/ + return (0); + } + + /* +* The most efficent way to find a symbol would be to calculate a +* hash, find proper bucket and chain, and thus find a symbol. +* However, that would involve code duplication (e.g. for hash +* function). So we're using simpler and a bit slower way: we're +* iterating through symbols, searching for the one which name is +* 'equal' to 'fdt_static_dtb'. To speed up the process a little bit, +* we are eliminating symbols type of which is not STT_NOTYPE, or(and) +* those which binding attribute is not STB_GLOBAL. +*/ + for (i = 0; (vm_offset_t)(symtab + i) < esym; i++) { + COPYOUT(symtab + i, &sym, sizeof(sym)); + if (ELF_ST_BIND(sym.st_info) != STB_GLOBAL || + ELF_ST_TYPE(sym.st_info) != STT_NOTYPE) + continue; + + strp = strdupout((vm_offset_t)(strtab + sym.st_name)); + if (strcmp(strp, FDT_STATIC_DTB_SYMBOL) == 0) { + /* Found a match ! */ + free(strp); + return ((vm_offset_t)(sym.st_value + offs)); + } + free(strp); + } + return (0); +} + static int fdt_setup_fdtp() { @@ -103,10 +190,14 @@ fdt_setup_fdtp() */ bfp = file_findfile(NULL, "dtb"); if (bfp == NULL) { - command_errmsg = "no device tree blob loaded"; - return (CMD_ERROR); + if ((fdtp = (struct fdt_head *)fdt_find_static_dtb()) == 0) { + command_errmsg = "no device tree blob found!"; + return (CMD_ERROR); + } + } else { + /* Dynamic blob has precedence over static. */ + fdtp = (struct fdt_header *)bfp->f_addr; } - fdtp = (struct fdt_header *)bfp->f_addr; /* * Validate the blob. @@ -448,7 +539,10
svn commit: r233323 - head/sys/boot/fdt
Author: raj Date: Thu Mar 22 20:34:26 2012 New Revision: 233323 URL: http://svn.freebsd.org/changeset/base/233323 Log: Improve FDT handling in loader(8) and make it more robust. o Fix buffer overflows when using a long property body in node paths. o Fix loop end condition when iterating through the symbol table. o Better error handling during node modification, better problem reporting. o Eliminate build time warnings. Submitted by: Lukasz Wojcik Obtained from:Semihalf MFC after:1 week Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c == --- head/sys/boot/fdt/fdt_loader_cmd.c Thu Mar 22 20:31:52 2012 (r233322) +++ head/sys/boot/fdt/fdt_loader_cmd.c Thu Mar 22 20:34:26 2012 (r233323) @@ -57,8 +57,6 @@ __FBSDID("$FreeBSD$"); #define STR(number) #number #define STRINGIFY(number) STR(number) -#define MIN(num1, num2)(((num1) < (num2)) ? (num1):(num2)) - #define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l) #define FDT_STATIC_DTB_SYMBOL "fdt_static_dtb" @@ -110,9 +108,11 @@ fdt_find_static_dtb(void) Elf_Sym *symtab; Elf_Dyn *dyn; char *strtab, *strp; - int i; + int i, sym_count; - esym = strtab = symtab = 0; + symtab = NULL; + dyntab = esym = 0; + strtab = strp = NULL; offs = __elfN(relocation_offset); @@ -129,6 +129,7 @@ fdt_find_static_dtb(void) if (md == NULL) return (0); COPYOUT(md->md_data, &dyntab, sizeof(dyntab)); + dyntab += offs; /* Locate STRTAB and DYNTAB */ @@ -152,6 +153,8 @@ fdt_find_static_dtb(void) return (0); } + sym_count = (int)((Elf_Sym *)esym - symtab) / sizeof(Elf_Sym); + /* * The most efficent way to find a symbol would be to calculate a * hash, find proper bucket and chain, and thus find a symbol. @@ -162,7 +165,7 @@ fdt_find_static_dtb(void) * we are eliminating symbols type of which is not STT_NOTYPE, or(and) * those which binding attribute is not STB_GLOBAL. */ - for (i = 0; (vm_offset_t)(symtab + i) < esym; i++) { + for (i = 0; i < sym_count; i++) { COPYOUT(symtab + i, &sym, sizeof(sym)); if (ELF_ST_BIND(sym.st_info) != STB_GLOBAL || ELF_ST_TYPE(sym.st_info) != STT_NOTYPE) @@ -190,7 +193,7 @@ fdt_setup_fdtp() */ bfp = file_findfile(NULL, "dtb"); if (bfp == NULL) { - if ((fdtp = (struct fdt_head *)fdt_find_static_dtb()) == 0) { + if ((fdtp = (struct fdt_header *)fdt_find_static_dtb()) == 0) { command_errmsg = "no device tree blob found!"; return (CMD_ERROR); } @@ -842,32 +845,41 @@ fdt_isprint(const void *data, int len, i static int fdt_data_str(const void *data, int len, int count, char **buf) { - char tmp[80], *b; + char *b, *tmp; const char *d; - int i, l; + int buf_len, i, l; /* * Calculate the length for the string and allocate memory. * -* Note len already includes at least one terminator. +* Note that 'len' already includes at least one terminator. */ - l = len; + buf_len = len; if (count > 1) { /* * Each token had already a terminator buried in 'len', but we * only need one eventually, don't count space for these. */ - l -= count - 1; + buf_len -= count - 1; /* Each consecutive token requires a ", " separator. */ - l += count * 2; + buf_len += count * 2; } - /* Space for surrounding double quotes. */ - l += count * 2; - b = (char *)malloc(l); + /* Add some space for surrounding double quotes. */ + buf_len += count * 2; + + /* Note that string being put in 'tmp' may be as big as 'buf_len'. */ + b = (char *)malloc(buf_len); + tmp = (char *)malloc(buf_len); if (b == NULL) - return (1); + goto error; + + if (tmp == NULL) { + free(b); + goto error; + } + b[0] = '\0'; /* @@ -887,13 +899,17 @@ fdt_data_str(const void *data, int len, } while (i < len); *buf = b; + free(tmp); + return (0); +error: + return (1); } static int fdt_data_cell(const void *data, int len, char **buf) { - char tmp[80], *b; + char *b, *tmp; const uint32_t *c; int count, i, l; @@ -916,8 +932,14 @@ fdt_data_cell(const void *data, int len, l += 3; b = (char *)malloc(l); + tmp = (char *)malloc(l); if (b == NULL) - return (1
Re: svn commit: r230622 - head
On 2012-01-27, at 19:29, Dimitry Andric wrote: > Author: dim > Date: Fri Jan 27 18:29:03 2012 > New Revision: 230622 > URL: http://svn.freebsd.org/changeset/base/230622 > > Log: > When the buildkernel stage 2.3 (build tools) runs, the PATH is still set > to the default from the top-level Makefile. Therefore, invocations of > lex and yacc (used during building of aicasm) will use the executables > in /usr/bin, not those optionally built during the previous buildworld > or kernel-toolchain. This makes kernel builds from older FreeBSD > releases more difficult than necessary. > > Fix this by setting PATH to ${BPATH}:${PATH} in stage 2.3, so the > bootstrap tools directories are searched before the regular ones. Is this supposed to work for cross building as well? I'm still encountering problems on a 7.3 host build: 1. Cross world builds fine make -j 8 buildworld TARGET_ARCH=arm 2. Kernel fails w/ the aicasm make buildkernel TARGET_ARCH=arm KERNCONF=SHEEVAPLUG [...] cc -O2 -pipe -nostdinc -I/usr/include -I. -I/home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wno-pointer-sign -c aicasm_scan.c cc1: warnings being treated as errors /home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm/aicasm_scan.l:837: warning: function declaration isn't a prototype *** Error code 1 Stop in /home/raj/work/obj/arm.arm/home/raj/work/svn/base/head/sys/SHEEVAPLUG. *** Error code 1 Stop in /home/raj/work/svn/base/head. *** Error code 1 Stop in /home/raj/work/svn/base/head. Do you know any workarounds to this? Rafal ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r230622 - head
On 2012-01-30, at 21:08, Dimitry Andric wrote: > On 2012-01-30 20:27, Rafal Jaworowski wrote: > ... >>> Fix this by setting PATH to ${BPATH}:${PATH} in stage 2.3, so the >>> bootstrap tools directories are searched before the regular ones. >> >> Is this supposed to work for cross building as well? I'm still encountering >> problems on a 7.3 host build: >> >> 1. Cross world builds fine >> make -j 8 buildworld TARGET_ARCH=arm >> >> 2. Kernel fails w/ the aicasm >> make buildkernel TARGET_ARCH=arm KERNCONF=SHEEVAPLUG >> [...] >> cc -O2 -pipe -nostdinc -I/usr/include -I. >> -I/home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm -std=gnu99 >> -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter >> -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type >> -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter >> -Wcast-align -Wno-pointer-sign -c aicasm_scan.c >> cc1: warnings being treated as errors >> /home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm/aicasm_scan.l:837: >> warning: function declaration isn't a prototype > > Can you please try doing "make buildenv TARGET_ARCH=arm", then run > "which lex" and "which yacc"? make buildenv TARGET_ARCH=arm Entering world for arm:arm $ which lex /home/raj/work/obj//arm.arm/home/raj/work/svn/base/head/tmp/legacy/usr/bin/lex $ which yacc /home/raj/work/obj//arm.arm/home/raj/work/svn/base/head/tmp/legacy/usr/bin/yacc $ They seem freshly built (from the earlier buildworld run). Rafal ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r230622 - head
On 2012-01-30, at 22:56, Dimitry Andric wrote: > On 2012-01-30 21:48, Ian Lepore wrote: >> On Mon, 2012-01-30 at 21:08 +0100, Dimitry Andric wrote: >>> On 2012-01-30 20:27, Rafal Jaworowski wrote: >>> ... >>>>> Fix this by setting PATH to ${BPATH}:${PATH} in stage 2.3, so the >>>>> bootstrap tools directories are searched before the regular ones. >>>> >>>> Is this supposed to work for cross building as well? I'm still >>>> encountering problems on a 7.3 host build: >>>> >>>> 1. Cross world builds fine >>>> make -j 8 buildworld TARGET_ARCH=arm >>>> >>>> 2. Kernel fails w/ the aicasm >>>> make buildkernel TARGET_ARCH=arm KERNCONF=SHEEVAPLUG >>>> [...] >>>> cc -O2 -pipe -nostdinc -I/usr/include -I. >>>> -I/home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm -std=gnu99 >>>> -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter >>>> -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type >>>> -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter >>>> -Wcast-align -Wno-pointer-sign -c aicasm_scan.c >>>> cc1: warnings being treated as errors >>>> /home/raj/work/svn/base/head/sys/dev/aic7xxx/aicasm/aicasm_scan.l:837: >>>> warning: function declaration isn't a prototype >>> >>> Can you please try doing "make buildenv TARGET_ARCH=arm", then run >>> "which lex" and "which yacc"? >> >> Shouldn't lex and yacc be listed in the Makefile.inc1 bootstrap-tools >> target for this to be fully effective? It looks like neither is in >> RELENG_7 and lex is only conditionally listed in RELENG_8. > > It is, for head at least (but I think I will MFC this change, if it > turns out to work correctly). Look in Makefile.inc1, around line 1030: > > .if ${BOOTSTRAPPING} < 96 > _lex= usr.bin/lex > _yacc=usr.bin/yacc > .endif > > I have assumed Rafal is building a head checkout on 7.3 release. Since > BOOTSTRAPPING will most likely be 703000, the lex and yacc targets are > built during the bootstrap-tools stage. > > That said, I still don't understand why the generated aicasm_scan.c file > is still defining the input() function. Rafal, just to be sure, can you > please paste the file that was generated during your buildkernel? Problem identified: the auto-gen'd aicasm files would not get updated in the preexisting kernel OBJ subdir. After wiping out the OBJ sub dir entirely make buildkernel works fine. Do you know why would the generated aicasm* files not get a refresh in the kernel OBJ dir? Rafal ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r230622 - head
On 2012-01-31, at 14:53, Dimitry Andric wrote: > On 2012-01-31 14:20, Rafal Jaworowski wrote: >> On 2012-01-30, at 22:56, Dimitry Andric wrote: > ... >>> That said, I still don't understand why the generated aicasm_scan.c file >>> is still defining the input() function. Rafal, just to be sure, can you >>> please paste the file that was generated during your buildkernel? >> >> Problem identified: the auto-gen'd aicasm files would not get updated in the >> preexisting kernel OBJ subdir. After wiping out the OBJ sub dir entirely >> make buildkernel works fine. >> >> Do you know why would the generated aicasm* files not get a refresh in the >> kernel OBJ dir? > > Well, in general, incremental building is difficult to get working for > all corner cases, like this particular one. The lexer and scanner .c > files are generated from .l and .y files, so if the latter did not get > an updated timestamp, the .c files will not be regenerated either. > > The only way to fix this would be to add a dependency on the actual lex > and yacc executables. But that is probably overkill: if you wanted to > be consistent, you would also have to relink every executable if ld gets > updated, recompile every object file if cc gets updated, and so on. > > It's probably easier to just clean out your object tree, and build from > scratch. :) Sure, I was just curious. Thanks for help! Rafal ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r230865 - head/sys/dev/mvs
Author: raj Date: Wed Feb 1 13:39:52 2012 New Revision: 230865 URL: http://svn.freebsd.org/changeset/base/230865 Log: Adjust mvs(4) to handle interrupt cause reg depending on the actual number of channels available - current code treats bits 4:7 in 'SATAHC interrupt mask' and 'SATAHC interrupt cause' as flags for SATA channels 2 and 3 - for embedded SATA controllers (SoC) these bits have been marked as reserved in datasheets so far, but for some new and upcoming chips they are used for purposes other than SATA Submitted by: Lukasz Plachno Reviewed by: mav Obtained from:Semihalf MFC after:2 weeks Modified: head/sys/dev/mvs/mvs.h head/sys/dev/mvs/mvs_soc.c Modified: head/sys/dev/mvs/mvs.h == --- head/sys/dev/mvs/mvs.h Wed Feb 1 13:33:53 2012(r230864) +++ head/sys/dev/mvs/mvs.h Wed Feb 1 13:39:52 2012(r230865) @@ -61,6 +61,9 @@ #define CHIP_SOC_LED 0x2C/* SoC LED Configuration */ +/* Additional mask for SoC devices with less than 4 channels */ +#define CHIP_SOC_HC0_MASK(num) (0xff >> ((4 - (num)) * 2)) + /* Chip CCC registers */ #define CHIP_ICC 0x18008 #define CHIP_ICC_ALL_PORTS (1 << 4) /* all ports irq event */ Modified: head/sys/dev/mvs/mvs_soc.c == --- head/sys/dev/mvs/mvs_soc.c Wed Feb 1 13:33:53 2012(r230864) +++ head/sys/dev/mvs/mvs_soc.c Wed Feb 1 13:39:52 2012(r230865) @@ -216,7 +216,9 @@ mvs_ctlr_setup(device_t dev) if (ccc) ccim |= IC_HC0_COAL_DONE; /* Enable chip interrupts */ - ctlr->gmim = (ccc ? IC_HC0_COAL_DONE : IC_DONE_HC0) | IC_ERR_HC0; + ctlr->gmim = ((ccc ? IC_HC0_COAL_DONE : + (IC_DONE_HC0 & CHIP_SOC_HC0_MASK(ctlr->channels))) | + (IC_ERR_HC0 & CHIP_SOC_HC0_MASK(ctlr->channels))); ATA_OUTL(ctlr->r_mem, CHIP_SOC_MIM, ctlr->gmim | ctlr->pmim); return (0); } @@ -291,25 +293,26 @@ mvs_intr(void *data) struct mvs_controller *ctlr = data; struct mvs_intr_arg arg; void (*function)(void *); - int p; + int p, chan_num; u_int32_t ic, aic; ic = ATA_INL(ctlr->r_mem, CHIP_SOC_MIC); if ((ic & IC_HC0) == 0) return; + /* Acknowledge interrupts of this HC. */ aic = 0; - if (ic & (IC_DONE_IRQ << 0)) - aic |= HC_IC_DONE(0) | HC_IC_DEV(0); - if (ic & (IC_DONE_IRQ << 2)) - aic |= HC_IC_DONE(1) | HC_IC_DEV(1); - if (ic & (IC_DONE_IRQ << 4)) - aic |= HC_IC_DONE(2) | HC_IC_DEV(2); - if (ic & (IC_DONE_IRQ << 6)) - aic |= HC_IC_DONE(3) | HC_IC_DEV(3); + + /* Processing interrupts from each initialized channel */ + for (chan_num = 0; chan_num < ctlr->channels; chan_num++) { + if (ic & (IC_DONE_IRQ << (chan_num * 2))) + aic |= HC_IC_DONE(chan_num) | HC_IC_DEV(chan_num); + } + if (ic & IC_HC0_COAL_DONE) aic |= HC_IC_COAL; ATA_OUTL(ctlr->r_mem, HC_IC, ~aic); + /* Call per-port interrupt handler. */ for (p = 0; p < ctlr->channels; p++) { arg.cause = ic & (IC_ERR_IRQ|IC_DONE_IRQ); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r235936 - in head/sys/powerpc: aim booke include powerpc
Author: raj Date: Thu May 24 21:13:24 2012 New Revision: 235936 URL: http://svn.freebsd.org/changeset/base/235936 Log: Fix physical address type to vm_paddr_t. Modified: head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/pmap.h head/sys/powerpc/powerpc/platform.c head/sys/powerpc/powerpc/pmap_dispatch.c Modified: head/sys/powerpc/aim/mmu_oea.c == --- head/sys/powerpc/aim/mmu_oea.c Thu May 24 21:09:38 2012 (r235935) +++ head/sys/powerpc/aim/mmu_oea.c Thu May 24 21:13:24 2012 (r235936) @@ -289,7 +289,7 @@ boolean_t moea_is_modified(mmu_t, vm_pag boolean_t moea_is_prefaultable(mmu_t, pmap_t, vm_offset_t); boolean_t moea_is_referenced(mmu_t, vm_page_t); boolean_t moea_ts_referenced(mmu_t, vm_page_t); -vm_offset_t moea_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t, int); +vm_offset_t moea_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); boolean_t moea_page_exists_quick(mmu_t, pmap_t, vm_page_t); int moea_page_wired_mappings(mmu_t, vm_page_t); void moea_pinit(mmu_t, pmap_t); @@ -308,14 +308,14 @@ void moea_activate(mmu_t, struct thread void moea_deactivate(mmu_t, struct thread *); void moea_cpu_bootstrap(mmu_t, int); void moea_bootstrap(mmu_t, vm_offset_t, vm_offset_t); -void *moea_mapdev(mmu_t, vm_offset_t, vm_size_t); +void *moea_mapdev(mmu_t, vm_paddr_t, vm_size_t); void *moea_mapdev_attr(mmu_t, vm_offset_t, vm_size_t, vm_memattr_t); void moea_unmapdev(mmu_t, vm_offset_t, vm_size_t); -vm_offset_t moea_kextract(mmu_t, vm_offset_t); +vm_paddr_t moea_kextract(mmu_t, vm_offset_t); void moea_kenter_attr(mmu_t, vm_offset_t, vm_offset_t, vm_memattr_t); -void moea_kenter(mmu_t, vm_offset_t, vm_offset_t); +void moea_kenter(mmu_t, vm_offset_t, vm_paddr_t); void moea_page_set_memattr(mmu_t mmu, vm_page_t m, vm_memattr_t ma); -boolean_t moea_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t); +boolean_t moea_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t); static void moea_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t); static mmu_method_t moea_methods[] = { @@ -1436,7 +1436,7 @@ moea_page_set_memattr(mmu_t mmu, vm_page * Map a wired page into kernel virtual address space. */ void -moea_kenter(mmu_t mmu, vm_offset_t va, vm_offset_t pa) +moea_kenter(mmu_t mmu, vm_offset_t va, vm_paddr_t pa) { moea_kenter_attr(mmu, va, pa, VM_MEMATTR_DEFAULT); @@ -1471,7 +1471,7 @@ moea_kenter_attr(mmu_t mmu, vm_offset_t * Extract the physical page address associated with the given kernel virtual * address. */ -vm_offset_t +vm_paddr_t moea_kextract(mmu_t mmu, vm_offset_t va) { struct pvo_entry *pvo; @@ -1512,8 +1512,8 @@ moea_kremove(mmu_t mmu, vm_offset_t va) * first usable address after the mapped region. */ vm_offset_t -moea_map(mmu_t mmu, vm_offset_t *virt, vm_offset_t pa_start, -vm_offset_t pa_end, int prot) +moea_map(mmu_t mmu, vm_offset_t *virt, vm_paddr_t pa_start, +vm_paddr_t pa_end, int prot) { vm_offset_t sva, va; @@ -2408,7 +2408,7 @@ moea_bat_mapped(int idx, vm_offset_t pa, } boolean_t -moea_dev_direct_mapped(mmu_t mmu, vm_offset_t pa, vm_size_t size) +moea_dev_direct_mapped(mmu_t mmu, vm_paddr_t pa, vm_size_t size) { int i; @@ -2431,7 +2431,7 @@ moea_dev_direct_mapped(mmu_t mmu, vm_off * NOT real memory. */ void * -moea_mapdev(mmu_t mmu, vm_offset_t pa, vm_size_t size) +moea_mapdev(mmu_t mmu, vm_paddr_t pa, vm_size_t size) { return (moea_mapdev_attr(mmu, pa, size, VM_MEMATTR_DEFAULT)); Modified: head/sys/powerpc/booke/pmap.c == --- head/sys/powerpc/booke/pmap.c Thu May 24 21:09:38 2012 (r235935) +++ head/sys/powerpc/booke/pmap.c Thu May 24 21:13:24 2012 (r235936) @@ -291,7 +291,7 @@ static boolean_tmmu_booke_is_modified(m static boolean_t mmu_booke_is_prefaultable(mmu_t, pmap_t, vm_offset_t); static boolean_t mmu_booke_is_referenced(mmu_t, vm_page_t); static boolean_t mmu_booke_ts_referenced(mmu_t, vm_page_t); -static vm_offset_t mmu_booke_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t, +static vm_offset_t mmu_booke_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); static int mmu_booke_mincore(mmu_t, pmap_t, vm_offset_t, vm_paddr_t *); @@ -316,12 +316,12 @@ static void mmu_booke_zero_page_idle(mm static voidmmu_booke_activate(mmu_t, struct thread *); static voidmmu_booke_deactivate(mmu_t, struct thread *); static voidmmu_booke_bootstrap(mmu_t, vm_offset_t, vm_offset_t); -static void*mmu_booke_mapdev(mmu_t, vm_offset_t, vm_size_t); +static void*mmu_booke_mapdev(mmu_t, vm_paddr_t, vm_size_t); static voidmmu_booke_unmapdev(mmu_t, vm_offset_t, vm_size_t); -static vm_offset_t mmu_booke_kex
svn commit: r235938 - head/sys/dev/sec
Author: raj Date: Thu May 24 21:24:23 2012 New Revision: 235938 URL: http://svn.freebsd.org/changeset/base/235938 Log: Recognize version 3.1 of the SEC crypto engine. Modified: head/sys/dev/sec/sec.c head/sys/dev/sec/sec.h Modified: head/sys/dev/sec/sec.c == --- head/sys/dev/sec/sec.c Thu May 24 21:23:13 2012(r235937) +++ head/sys/dev/sec/sec.c Thu May 24 21:24:23 2012(r235938) @@ -227,6 +227,10 @@ sec_probe(device_t dev) device_set_desc(dev, "Freescale Security Engine 3.0"); sc->sc_version = 3; break; + case SEC_31_ID: + device_set_desc(dev, "Freescale Security Engine 3.1"); + sc->sc_version = 3; + break; default: device_printf(dev, "unknown SEC ID 0x%016llx!\n", id); return (ENXIO); Modified: head/sys/dev/sec/sec.h == --- head/sys/dev/sec/sec.h Thu May 24 21:23:13 2012(r235937) +++ head/sys/dev/sec/sec.h Thu May 24 21:24:23 2012(r235938) @@ -46,6 +46,7 @@ /* SEC information */ #define SEC_20_ID 0x0040ULL #define SEC_30_ID 0x00300300ULL +#define SEC_31_ID 0x00300301ULL #define SEC_CHANNELS 4 #define SEC_POINTERS 7 #define SEC_MAX_DMA_BLOCK_SIZE 0x ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r235999 - head/sys/dev/mii
Author: raj Date: Fri May 25 15:05:17 2012 New Revision: 235999 URL: http://svn.freebsd.org/changeset/base/235999 Log: More Cicada/Vitesse PHY ids. Obtained from:Semihalf Modified: head/sys/dev/mii/ciphy.c head/sys/dev/mii/miidevs Modified: head/sys/dev/mii/ciphy.c == --- head/sys/dev/mii/ciphy.cFri May 25 14:57:02 2012(r235998) +++ head/sys/dev/mii/ciphy.cFri May 25 15:05:17 2012(r235999) @@ -91,8 +91,10 @@ static const struct mii_phydesc ciphys[] MII_PHY_DESC(xxCICADA, CS8201B), MII_PHY_DESC(xxCICADA, CS8204), MII_PHY_DESC(xxCICADA, VSC8211), + MII_PHY_DESC(xxCICADA, VSC8221), MII_PHY_DESC(xxCICADA, CS8244), MII_PHY_DESC(xxVITESSE, VSC8601), + MII_PHY_DESC(xxVITESSE, VSC8641), MII_PHY_END }; @@ -368,8 +370,10 @@ ciphy_fixup(struct mii_softc *sc) break; case MII_MODEL_xxCICADA_VSC8211: + case MII_MODEL_xxCICADA_VSC8221: case MII_MODEL_xxCICADA_CS8244: case MII_MODEL_xxVITESSE_VSC8601: + case MII_MODEL_xxVITESSE_VSC8641: break; default: device_printf(sc->mii_dev, "unknown CICADA PHY model %x\n", Modified: head/sys/dev/mii/miidevs == --- head/sys/dev/mii/miidevsFri May 25 14:57:02 2012(r235998) +++ head/sys/dev/mii/miidevsFri May 25 15:05:17 2012(r235999) @@ -52,7 +52,7 @@ oui AMD 0x1a Advanced Micro Devic oui BROADCOM 0x001018Broadcom Corporation oui BROADCOM2 0x000af7Broadcom Corporation oui BROADCOM3 0x001be9Broadcom Corporation -oui CICADA 0x0003F1Cicada Semiconductor +oui CICADA 0x0003f1Cicada Semiconductor oui DAVICOM0x00606eDavicom Semiconductor oui ENABLESEMI 0x0010ddEnable Semiconductor oui ICPLUS 0x0090c3IC Plus Corp. @@ -71,6 +71,7 @@ oui SEEQ 0x00a07dSeeq Technology oui SIS0x00e006Silicon Integrated Systems oui TI 0x080028Texas Instruments oui TSC0x00c039TDK Semiconductor +oui VITESSE0x0001c1Vitesse Semiconductor oui XAQTI 0x00e0aeXaQti Corp. /* Some Intel 82553's use an alternative OUI. */ @@ -190,6 +191,7 @@ model xxBROADCOM_ALT1 BCM5906 0x0004 BCM model xxCICADA CS8201 0x0001 Cicada CS8201 10/100/1000TX PHY model xxCICADA CS8204 0x0004 Cicada CS8204 10/100/1000TX PHY model xxCICADA VSC8211 0x000b Cicada VSC8211 10/100/1000TX PHY +model xxCICADA VSC8221 0x0015 Cicada CS8201 10/100/1000TX PHY model xxCICADA CS8201A 0x0020 Cicada CS8201 10/100/1000TX PHY model xxCICADA CS8201B 0x0021 Cicada CS8201 10/100/1000TX PHY model xxCICADA CS8244 0x002c Cicada CS8244 10/100/1000TX PHY @@ -318,5 +320,8 @@ model TI TNETE2101 0x0003 TNETE2101 med model xxTSC 78Q21200x0014 78Q2120 10/100 media interface model xxTSC 78Q21210x0015 78Q2121 100BASE-TX media interface +/* Vitesse Semiconductor */ +model xxVITESSE VSC86410x0003 Vitesse VSC8641 10/100/1000TX PHY + /* XaQti Corp. PHYs */ model xxXAQTI XMACII 0x XaQti Corp. XMAC II gigabit interface ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r236000 - head/sys/powerpc/powerpc
Author: raj Date: Fri May 25 15:13:55 2012 New Revision: 236000 URL: http://svn.freebsd.org/changeset/base/236000 Log: Missing vm_paddr_t bits which should have been part of r235936. Modified: head/sys/powerpc/powerpc/mmu_if.m Modified: head/sys/powerpc/powerpc/mmu_if.m == --- head/sys/powerpc/powerpc/mmu_if.m Fri May 25 15:05:17 2012 (r235999) +++ head/sys/powerpc/powerpc/mmu_if.m Fri May 25 15:13:55 2012 (r236000) @@ -761,7 +761,7 @@ METHOD void cpu_bootstrap { */ METHOD void * mapdev { mmu_t _mmu; - vm_offset_t _pa; + vm_paddr_t _pa; vm_size_t _size; }; @@ -818,7 +818,7 @@ METHOD void unmapdev { * * @retval pa physical address corresponding to mapping */ -METHOD vm_offset_t kextract { +METHOD vm_paddr_t kextract { mmu_t _mmu; vm_offset_t _va; }; @@ -833,7 +833,7 @@ METHOD vm_offset_t kextract { METHOD void kenter { mmu_t _mmu; vm_offset_t _va; - vm_offset_t _pa; + vm_paddr_t _pa; }; /** @@ -860,7 +860,7 @@ METHOD void kenter_attr { */ METHOD boolean_t dev_direct_mapped { mmu_t _mmu; - vm_offset_t _pa; + vm_paddr_t _pa; vm_size_t _size; }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r236000 - head/sys/powerpc/powerpc
On 2012-05-25, at 17:28, Nathan Whitehorn wrote: > On 05/25/12 10:13, Rafal Jaworowski wrote: >> Author: raj >> Date: Fri May 25 15:13:55 2012 >> New Revision: 236000 >> URL: http://svn.freebsd.org/changeset/base/236000 >> >> Log: >> Missing vm_paddr_t bits which should have been part of r235936. > > I think you also need equivalent changes to aim/mmu_oea64.c. Yes, but the GENERIC64 build appears currently broken, so I could not compile test it. Rafal ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r236000 - head/sys/powerpc/powerpc
On 2012-05-25, at 19:06, Rafal Jaworowski wrote: > > On 2012-05-25, at 17:28, Nathan Whitehorn wrote: > >> On 05/25/12 10:13, Rafal Jaworowski wrote: >>> Author: raj >>> Date: Fri May 25 15:13:55 2012 >>> New Revision: 236000 >>> URL: http://svn.freebsd.org/changeset/base/236000 >>> >>> Log: >>> Missing vm_paddr_t bits which should have been part of r235936. >> >> I think you also need equivalent changes to aim/mmu_oea64.c. > > Yes, but the GENERIC64 build appears currently broken, so I could not compile > test it. Sorry for the noise, I had some old powerpc64 build env locally, the build is fine. I'll commit the vm_paddr_t fix shortly. Rafal ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r236019 - head/sys/powerpc/aim
Author: raj Date: Fri May 25 18:17:26 2012 New Revision: 236019 URL: http://svn.freebsd.org/changeset/base/236019 Log: Fix physical address type to vm_paddr_t also for powerpc64. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c == --- head/sys/powerpc/aim/mmu_oea64.cFri May 25 17:56:27 2012 (r236018) +++ head/sys/powerpc/aim/mmu_oea64.cFri May 25 18:17:26 2012 (r236019) @@ -306,7 +306,7 @@ boolean_t moea64_is_modified(mmu_t, vm_p boolean_t moea64_is_prefaultable(mmu_t, pmap_t, vm_offset_t); boolean_t moea64_is_referenced(mmu_t, vm_page_t); boolean_t moea64_ts_referenced(mmu_t, vm_page_t); -vm_offset_t moea64_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t, int); +vm_offset_t moea64_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); boolean_t moea64_page_exists_quick(mmu_t, pmap_t, vm_page_t); int moea64_page_wired_mappings(mmu_t, vm_page_t); void moea64_pinit(mmu_t, pmap_t); @@ -324,14 +324,14 @@ void moea64_zero_page_area(mmu_t, vm_pag void moea64_zero_page_idle(mmu_t, vm_page_t); void moea64_activate(mmu_t, struct thread *); void moea64_deactivate(mmu_t, struct thread *); -void *moea64_mapdev(mmu_t, vm_offset_t, vm_size_t); +void *moea64_mapdev(mmu_t, vm_paddr_t, vm_size_t); void *moea64_mapdev_attr(mmu_t, vm_offset_t, vm_size_t, vm_memattr_t); void moea64_unmapdev(mmu_t, vm_offset_t, vm_size_t); -vm_offset_t moea64_kextract(mmu_t, vm_offset_t); +vm_paddr_t moea64_kextract(mmu_t, vm_offset_t); void moea64_page_set_memattr(mmu_t, vm_page_t m, vm_memattr_t ma); void moea64_kenter_attr(mmu_t, vm_offset_t, vm_offset_t, vm_memattr_t ma); -void moea64_kenter(mmu_t, vm_offset_t, vm_offset_t); -boolean_t moea64_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t); +void moea64_kenter(mmu_t, vm_offset_t, vm_paddr_t); +boolean_t moea64_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t); static void moea64_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t); static mmu_method_t moea64_methods[] = { @@ -1641,7 +1641,7 @@ moea64_kenter_attr(mmu_t mmu, vm_offset_ } void -moea64_kenter(mmu_t mmu, vm_offset_t va, vm_offset_t pa) +moea64_kenter(mmu_t mmu, vm_offset_t va, vm_paddr_t pa) { moea64_kenter_attr(mmu, va, pa, VM_MEMATTR_DEFAULT); @@ -1651,7 +1651,7 @@ moea64_kenter(mmu_t mmu, vm_offset_t va, * Extract the physical page address associated with the given kernel virtual * address. */ -vm_offset_t +vm_paddr_t moea64_kextract(mmu_t mmu, vm_offset_t va) { struct pvo_entry *pvo; @@ -1692,8 +1692,8 @@ moea64_kremove(mmu_t mmu, vm_offset_t va * first usable address after the mapped region. */ vm_offset_t -moea64_map(mmu_t mmu, vm_offset_t *virt, vm_offset_t pa_start, -vm_offset_t pa_end, int prot) +moea64_map(mmu_t mmu, vm_offset_t *virt, vm_paddr_t pa_start, +vm_paddr_t pa_end, int prot) { vm_offset_t sva, va; @@ -2440,7 +2440,7 @@ moea64_clear_bit(mmu_t mmu, vm_page_t m, } boolean_t -moea64_dev_direct_mapped(mmu_t mmu, vm_offset_t pa, vm_size_t size) +moea64_dev_direct_mapped(mmu_t mmu, vm_paddr_t pa, vm_size_t size) { struct pvo_entry *pvo, key; vm_offset_t ppa; @@ -2493,7 +2493,7 @@ moea64_mapdev_attr(mmu_t mmu, vm_offset_ } void * -moea64_mapdev(mmu_t mmu, vm_offset_t pa, vm_size_t size) +moea64_mapdev(mmu_t mmu, vm_paddr_t pa, vm_size_t size) { return moea64_mapdev_attr(mmu, pa, size, VM_MEMATTR_DEFAULT); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r236024 - head/sys/boot/fdt/dts
Author: raj Date: Fri May 25 20:43:38 2012 New Revision: 236024 URL: http://svn.freebsd.org/changeset/base/236024 Log: Import DTS files for the upcoming DPAA QorIQ (PowerPC) support. - P2041RDB - P3041DS - P5020DS Obtained from:Freescale Added: head/sys/boot/fdt/dts/p2041rdb.dts (contents, props changed) head/sys/boot/fdt/dts/p2041si.dtsi (contents, props changed) head/sys/boot/fdt/dts/p3041si.dtsi (contents, props changed) head/sys/boot/fdt/dts/p5020ds.dts (contents, props changed) head/sys/boot/fdt/dts/p5020si.dtsi (contents, props changed) Modified: head/sys/boot/fdt/dts/p3041ds.dts Added: head/sys/boot/fdt/dts/p2041rdb.dts == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/p2041rdb.dts Fri May 25 20:43:38 2012 (r236024) @@ -0,0 +1,490 @@ +/* + * P2041RDB Device Tree Source + * + * Copyright 2011 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``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 Freescale Semiconductor 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. + */ +/* $FreeBSD$ */ + +/include/ "p2041si.dtsi" + +/ { + model = "fsl,P2041RDB"; + compatible = "fsl,P2041RDB"; + #address-cells = <2>; + #size-cells = <2>; + interrupt-parent = <&mpic>; + + aliases { + phy_rgmii_0 = &phy_rgmii_0; + phy_rgmii_1 = &phy_rgmii_1; + phy_sgmii_2 = &phy_sgmii_2; + phy_sgmii_3 = &phy_sgmii_3; + phy_sgmii_4 = &phy_sgmii_4; + phy_sgmii_1c = &phy_sgmii_1c; + phy_sgmii_1d = &phy_sgmii_1d; + phy_sgmii_1e = &phy_sgmii_1e; + phy_sgmii_1f = &phy_sgmii_1f; + phy_xgmii_2 = &phy_xgmii_2; + }; + + memory { + device_type = "memory"; + reg = <0x 0x 0x 0x8000>; + }; + + dcsr: dcsr@f { + ranges = <0x 0xf 0x 0x01008000>; + }; + + bman-portals@ff400 { + bman-portal@0 { + cpu-handle = <&cpu0>; + }; + bman-portal@4000 { + cpu-handle = <&cpu1>; + }; + bman-portal@8000 { + cpu-handle = <&cpu2>; + }; + bman-portal@c000 { + cpu-handle = <&cpu3>; + }; + bman-portal@1 { + }; + bman-portal@14000 { + }; + bman-portal@18000 { + }; + bman-portal@1c000 { + }; + bman-portal@2 { + }; + bman-portal@24000 { + }; + + buffer-pool@0 { + compatible = "fsl,p2041-bpool", "fsl,bpool"; + fsl,bpid = <0>; + fsl,bpool-cfg = <0 0x100 0 1 0 0x100>; + }; + }; + + qman-portals@ff420 { + qportal0: qman-portal@0 { + cpu-handle = <&cpu0>; + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpo
svn commit: r236025 - head/sys/powerpc/include
Author: raj Date: Fri May 25 21:12:24 2012 New Revision: 236025 URL: http://svn.freebsd.org/changeset/base/236025 Log: Update HID defines for E500mc and E5500 CPU cores. Obtained from:Freescale, Semihalf Modified: head/sys/powerpc/include/hid.h Modified: head/sys/powerpc/include/hid.h == --- head/sys/powerpc/include/hid.h Fri May 25 20:43:38 2012 (r236024) +++ head/sys/powerpc/include/hid.h Fri May 25 21:12:24 2012 (r236025) @@ -78,6 +78,8 @@ #define HID0_E500_SEL_TBCLK0x2000 /* Select Time Base clock */ #define HID0_E500_MAS7UPDEN0x0080 /* Enable MAS7 update (e500v2) */ +#define HID0_E500MC_L2MMU_MHD 0x4000 /* L2MMU Multiple Hit Detection */ + #define HID0_BITMASK \ "\20" \ "\040EMCP\037DBP\036EBA\035EBD\034BCLK\033EICE\032ECLK\031PAR" \ @@ -105,6 +107,20 @@ "\027NAP\025DPM\023TG\022HANGDETECT\021NHR\020INORDER" \ "\016TBCTRL\015TBEN\012CIABREN\011HDICEEN\001ENATTN" +#define HID0_E500MC_BITMASK\ +"\20" \ +"\040EMCP\037EN_L2MMU_MHD\036b2\035b3\034b4\033b5\032b6\031b7" \ +"\030b8\027b9\026b10\025b11\024b12\023b13\022b14\021b15" \ +"\020b16\017b17\016b18\015b19\014b20\013b21\012b22\011b23" \ +"\010EN_MAS7_UPDATE\007DCFA\006b26\005CIGLSO\004b28\003b29\002b30\001NOPTI" + +#define HID0_E5500_BITMASK \ +"\20" \ +"\040EMCP\037EN_L2MMU_MHD\036b2\035b3\034b4\033b5\032b6\031b7" \ +"\030b8\027b9\026b10\025b11\024b12\023b13\022b14\021b15" \ +"\020b16\017b17\016b18\015b19\014b20\013b21\012b22\011b23" \ +"\010b24\007DCFA\006b26\005CIGLSO\004b28\003b29\002b30\001NOPTI" + /* * HID0 bit definitions per cpu model * @@ -142,6 +158,40 @@ * 30 - - - NOPDST NOPDST NOPDST NOPDST - * 31 NOOPTI - NOOPTI NOPTI NOPTI NOPTI NOPTI NOPTI * + * bit e500mc e5500 + * 0 EMCPEMCP + * 1 EN_L2MMU_MHDEN_L2MMU_MHD + * 2 - - + * 3 - - + * 4 - - + * 5 - - + * 6 - - + * 7 - - + * 8 - - + * 9 - - + * 10 - - + * 11 - - + * 12 - - + * 13 - - + * 14 - - + * 15 - - + * 16 - - + * 17 - - + * 18 - - + * 19 - - + * 20 - - + * 21 - - + * 22 - - + * 23 - - + * 24 EN_MAS7_UPDATE - + * 25 DCFADCFA + * 26 - - + * 27 CIGLSO CIGLSO + * 28 - - + * 29 - - + * 30 - - + * 31 NOPTI NOPTI + * * 604: ECP = Enable cache parity checking * 604: SIE = Serial instruction execution disable * 7450: TBEN = Time Base Enable @@ -160,6 +210,9 @@ #define HID0_E500_DEFAULT_SET (HID0_EMCP | HID0_E500_TBEN) #define HID1_E500_DEFAULT_SET (HID1_E500_ABE | HID1_E500_ASTME) +#define HID0_E500MC_DEFAULT_SET(HID0_EMCP | HID0_E500MC_L2MMU_MHD | \ +HID0_E500_MAS7UPDEN) +#define HID0_E5500_DEFAULT_SET (HID0_EMCP | HID0_E500MC_L2MMU_MHD) #define HID5_970_DCBZ_SIZE_HI 0x0080UL/* dcbz does a 32-byte store */ #define HID4_970_DISABLE_LG_PG 0x0004ULL /* disables large pages */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r236094 - head/sys/powerpc/include
Author: raj Date: Sat May 26 12:15:13 2012 New Revision: 236094 URL: http://svn.freebsd.org/changeset/base/236094 Log: Unify SPR defines formatting, no funtional changes. Modified: head/sys/powerpc/include/spr.h Modified: head/sys/powerpc/include/spr.h == --- head/sys/powerpc/include/spr.h Sat May 26 10:28:11 2012 (r236093) +++ head/sys/powerpc/include/spr.h Sat May 26 12:15:13 2012 (r236094) @@ -115,9 +115,9 @@ #define SRR1_ISI_NOEXECUTE0x1000 /* Memory marked no-execute */ #define SRR1_ISI_PP 0x0800 /* PP bits forbid access */ #defineSPR_DECAR 0x036 /* ..8 Decrementer auto reload */ -#define SPR_EIE0x050 /* ..8 Exception Interrupt ??? */ -#define SPR_EID0x051 /* ..8 Exception Interrupt ??? */ -#define SPR_NRI0x052 /* ..8 Exception Interrupt ??? */ +#defineSPR_EIE 0x050 /* ..8 Exception Interrupt ??? */ +#defineSPR_EID 0x051 /* ..8 Exception Interrupt ??? */ +#defineSPR_NRI 0x052 /* ..8 Exception Interrupt ??? */ #defineSPR_USPRG0 0x100 /* 4.. User SPR General 0 */ #defineSPR_VRSAVE 0x100 /* .6. AltiVec VRSAVE */ #defineSPR_SPRG0 0x110 /* 468 SPR General 0 */ @@ -202,49 +202,49 @@ #defineSPR_DBAT2L 0x21d /* .6. Data BAT Reg 2 Lower */ #defineSPR_DBAT3U 0x21e /* .6. Data BAT Reg 3 Upper */ #defineSPR_DBAT3L 0x21f /* .6. Data BAT Reg 3 Lower */ -#define SPR_IC_CST 0x230 /* ..8 Instruction Cache CSR */ -#define IC_CST_IEN0x8000 /* I cache is ENabled (RO) */ -#define IC_CST_CMD_INVALL 0x0c00 /* I cache invalidate all */ -#define IC_CST_CMD_UNLOCKALL 0x0a00 /* I cache unlock all */ -#define IC_CST_CMD_UNLOCK 0x0800 /* I cache unlock block */ -#define IC_CST_CMD_LOADLOCK 0x0600 /* I cache load & lock block */ -#define IC_CST_CMD_DISABLE0x0400 /* I cache disable */ -#define IC_CST_CMD_ENABLE 0x0200 /* I cache enable */ -#define IC_CST_CCER1 0x0020 /* I cache error type 1 (RO) */ -#define IC_CST_CCER2 0x0010 /* I cache error type 2 (RO) */ -#define IC_CST_CCER3 0x0008 /* I cache error type 3 (RO) */ +#defineSPR_IC_CST 0x230 /* ..8 Instruction Cache CSR */ +#define IC_CST_IEN0x8000 /* I cache is ENabled (RO) */ +#define IC_CST_CMD_INVALL 0x0c00 /* I cache invalidate all */ +#define IC_CST_CMD_UNLOCKALL 0x0a00 /* I cache unlock all */ +#define IC_CST_CMD_UNLOCK 0x0800 /* I cache unlock block */ +#define IC_CST_CMD_LOADLOCK 0x0600 /* I cache load & lock block */ +#define IC_CST_CMD_DISABLE0x0400 /* I cache disable */ +#define IC_CST_CMD_ENABLE 0x0200 /* I cache enable */ +#define IC_CST_CCER1 0x0020 /* I cache error type 1 (RO) */ +#define IC_CST_CCER2 0x0010 /* I cache error type 2 (RO) */ +#define IC_CST_CCER3 0x0008 /* I cache error type 3 (RO) */ #defineSPR_IBAT4U 0x230 /* .6. Instruction BAT Reg 4 Upper */ -#define SPR_IC_ADR 0x231 /* ..8 Instruction Cache Address */ +#defineSPR_IC_ADR 0x231 /* ..8 Instruction Cache Address */ #defineSPR_IBAT4L 0x231 /* .6. Instruction BAT Reg 4 Lower */ -#define SPR_IC_DAT 0x232 /* ..8 Instruction Cache Data */ +#defineSPR_IC_DAT 0x232 /* ..8 Instruction Cache Data */ #defineSPR_IBAT5U 0x232 /* .6. Instruction BAT Reg 5 Upper */ #defineSPR_IBAT5L 0x233 /* .6. Instruction BAT Reg 5 Lower */ #defineSPR_IBAT6U 0x234 /* .6. Instruction BAT Reg 6 Upper */ #defineSPR_IBAT6L 0x235 /* .6. Instruction BAT Reg 6 Lower */ #defineSPR_IBAT7U 0x236 /* .6. Instruction BAT Reg 7 Upper */ #defineSPR_IBAT7L 0x237 /* .6. Instruction BAT Reg 7 Lower */ -#define SPR_DC_CST 0x230 /* ..8 Data Cache CSR */ -#define DC_CST_DEN0x8000 /* D cache ENabled (RO) */ -#define DC_CST_DFWT 0x4000 /* D cache Force Write-Thru (RO) */ -#define DC_CST_LES0x2000 /* D cache Little Endian Swap (RO) */ -#define DC_CST_CMD_FLUSH 0x0e00 /* D cache invalidate all */ -#define DC_CST_CMD_INVALL 0x0c00 /* D cache invalidate all */ -#define DC_CST_CMD_UNLOCKALL 0x0a00 /* D cache unlock all */ -#define DC_CST_CMD_UNLOCK 0x0800 /* D cache unlock block
svn commit: r236095 - head/sys/powerpc/include
Author: raj Date: Sat May 26 12:39:23 2012 New Revision: 236095 URL: http://svn.freebsd.org/changeset/base/236095 Log: Provide SPR definitions for newer Book-E (E500mc, E5500, PPC465). Obtained from:Freescale, Semihalf. Modified: head/sys/powerpc/include/spr.h Modified: head/sys/powerpc/include/spr.h == --- head/sys/powerpc/include/spr.h Sat May 26 12:15:13 2012 (r236094) +++ head/sys/powerpc/include/spr.h Sat May 26 12:39:23 2012 (r236095) @@ -184,6 +184,8 @@ #define MPC8245 0x8081 #define FSL_E500v1 0x8020 #define FSL_E500v2 0x8021 +#define FSL_E500mc 0x8023 +#define FSL_E5500 0x8024 #defineSPR_IBAT0U 0x210 /* .68 Instruction BAT Reg 0 Upper */ #defineSPR_IBAT0U 0x210 /* .6. Instruction BAT Reg 0 Upper */ @@ -421,6 +423,7 @@ #defineSPR_SRR30x3df /* 4.. Save/Restore Register 3 */ #defineSPR_HID00x3f0 /* ..8 Hardware Implementation Register 0 */ #defineSPR_HID10x3f1 /* ..8 Hardware Implementation Register 1 */ +#defineSPR_HID20x3f3 /* ..8 Hardware Implementation Register 2 */ #defineSPR_HID40x3f4 /* ..8 Hardware Implementation Register 4 */ #defineSPR_HID50x3f6 /* ..8 Hardware Implementation Register 5 */ #defineSPR_HID60x3f9 /* ..8 Hardware Implementation Register 6 */ @@ -627,6 +630,8 @@ #elif defined(E500) +#defineSPR_MCSR0x23c /* ..8 Machine Check Syndrome register */ + #defineSPR_ESR 0x003e /* ..8 Exception Syndrome Register */ #define ESR_PIL 0x0800 /* Program interrupt - illegal */ #define ESR_PPR 0x0400 /* Program interrupt - privileged */ @@ -637,11 +642,16 @@ #define ESR_BO 0x0002 /* Data/instruction storage, byte ordering */ #define ESR_SPE 0x0080 /* SPE exception bit */ + #defineSPR_CSRR0 0x03a /* ..8 58 Critical SRR0 */ #defineSPR_CSRR1 0x03b /* ..8 59 Critical SRR1 */ #defineSPR_MCSRR0 0x23a /* ..8 570 Machine check SRR0 */ #defineSPR_MCSRR1 0x23b /* ..8 571 Machine check SRR1 */ +#defineSPR_MMUCSR0 0x3f4 /* ..8 1012 MMU Control and Status Register 0 */ +#define MMUCSR0_L2TLB0_FI 0x04/* TLB0 flash invalidate */ +#define MMUCSR0_L2TLB1_FI 0x02/* TLB1 flash invalidate */ + #defineSPR_SVR 0x3ff /* ..8 1023 System Version Register */ #define SVR_MPC8533 0x8034 #define SVR_MPC8533E0x803c @@ -661,10 +671,16 @@ #define SVR_P2010E 0x80eb #define SVR_P2020 0x80e2 #define SVR_P2020E 0x80ea +#define SVR_P2041 0x8210 +#define SVR_P2041E 0x8218 +#define SVR_P3041 0x8211 +#define SVR_P3041E 0x8219 #define SVR_P4040 0x8200 #define SVR_P4040E 0x8208 #define SVR_P4080 0x8201 #define SVR_P4080E 0x8209 +#define SVR_P5020 0x8220 +#define SVR_P5020E 0x8228 #defineSVR_VER(svr)(((svr) >> 16) & 0x) #defineSPR_PID00x030 /* ..8 Process ID Register 0 */ @@ -707,6 +723,18 @@ #defineSPR_MAS50x275 /* ..8 MMU Assist Register 5 Book-E */ #defineSPR_MAS60x276 /* ..8 MMU Assist Register 6 Book-E/e500 */ #defineSPR_MAS70x3B0 /* ..8 MMU Assist Register 7 Book-E/e500 */ +#defineSPR_MAS80x155 /* ..8 MMU Assist Register 8 Book-E/e500 */ + +#defineSPR_L1CFG0 0x203 /* ..8 L1 cache configuration register 0 */ +#defineSPR_L1CFG1 0x204 /* ..8 L1 cache configuration register 1 */ + +#defineSPR_CCR10x378 +#define CCR1_L2COBE 0x0040 + +#defineDCR_L2DCDCRAI 0x /* L2 D-Cache DCR Address Pointer */ +#defineDCR_L2DCDCRDI 0x0001 /* L2 D-Cache DCR Data Indirect */ +#defineDCR_L2CR0 0x00/* L2 Cache Configuration Register 0 */ +#define L2CR0_AS 0x3000 #defineSPR_L1CSR0 0x3F2 /* ..8 L1 Cache Control and Status Register 0 */ #define L1CSR0_DCPE 0x0001 /* Data Cache
svn commit: r236097 - in head/sys/powerpc: booke powerpc
Author: raj Date: Sat May 26 13:36:18 2012 New Revision: 236097 URL: http://svn.freebsd.org/changeset/base/236097 Log: Rename e500 prefix to match other Book-E CPU variations. CPU id tidbits for the new cores. Obtained from:Freescale, Semihalf. Modified: head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/platform_bare.c head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/booke/machdep.c == --- head/sys/powerpc/booke/machdep.cSat May 26 13:12:14 2012 (r236096) +++ head/sys/powerpc/booke/machdep.cSat May 26 13:36:18 2012 (r236097) @@ -185,8 +185,8 @@ SYSCTL_INT(_machdep, CPU_CACHELINE, cach int hw_direct_map = 0; -static void cpu_e500_startup(void *); -SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_e500_startup, NULL); +static void cpu_booke_startup(void *); +SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_booke_startup, NULL); void print_kernel_section_addr(void); void print_kenv(void); @@ -195,7 +195,7 @@ u_int booke_init(uint32_t, uint32_t); extern int elf32_nxstack; static void -cpu_e500_startup(void *dummy) +cpu_booke_startup(void *dummy) { int indx, size; @@ -538,7 +538,8 @@ cpu_halt(void) { mtmsr(mfmsr() & ~(PSL_CE | PSL_EE | PSL_ME | PSL_DE)); - while (1); + while (1) + ; } int Modified: head/sys/powerpc/booke/platform_bare.c == --- head/sys/powerpc/booke/platform_bare.c Sat May 26 13:12:14 2012 (r236096) +++ head/sys/powerpc/booke/platform_bare.c Sat May 26 13:36:18 2012 (r236097) @@ -73,7 +73,7 @@ static int bare_smp_next_cpu(platform_t, static int bare_smp_get_bsp(platform_t, struct cpuref *cpuref); static int bare_smp_start_cpu(platform_t, struct pcpu *cpu); -static void e500_reset(platform_t); +static void booke_reset(platform_t); static platform_method_t bare_methods[] = { PLATFORMMETHOD(platform_probe, bare_probe), @@ -85,7 +85,7 @@ static platform_method_t bare_methods[] PLATFORMMETHOD(platform_smp_get_bsp,bare_smp_get_bsp), PLATFORMMETHOD(platform_smp_start_cpu, bare_smp_start_cpu), - PLATFORMMETHOD(platform_reset, e500_reset), + PLATFORMMETHOD(platform_reset, booke_reset), { 0, 0 } }; @@ -307,7 +307,7 @@ bare_smp_start_cpu(platform_t plat, stru } static void -e500_reset(platform_t plat) +booke_reset(platform_t plat) { /* @@ -328,6 +328,7 @@ e500_reset(platform_t plat) mtspr(SPR_DBCR0, mfspr(SPR_DBCR0) | DBCR0_IDM | DBCR0_RST_SYSTEM); printf("Reset failed...\n"); - while (1); + while (1) + ; } Modified: head/sys/powerpc/powerpc/cpu.c == --- head/sys/powerpc/powerpc/cpu.c Sat May 26 13:12:14 2012 (r236096) +++ head/sys/powerpc/powerpc/cpu.c Sat May 26 13:36:18 2012 (r236097) @@ -75,13 +75,13 @@ #include static voidcpu_6xx_setup(int cpuid, uint16_t vers); -static voidcpu_e500_setup(int cpuid, uint16_t vers); static voidcpu_970_setup(int cpuid, uint16_t vers); +static voidcpu_booke_setup(int cpuid, uint16_t vers); int powerpc_pow_enabled; void (*cpu_idle_hook)(void) = NULL; static voidcpu_idle_60x(void); -static voidcpu_idle_e500(void); +static voidcpu_idle_booke(void); struct cputab { const char *name; @@ -146,9 +146,13 @@ static const struct cputab models[] = { { "Motorola PowerPC 8245", MPC8245,REVFMT_MAJMIN, PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, { "Freescale e500v1 core", FSL_E500v1, REVFMT_MAJMIN, - 0, cpu_e500_setup }, + 0, cpu_booke_setup }, { "Freescale e500v2 core", FSL_E500v2, REVFMT_MAJMIN, - 0, cpu_e500_setup }, + 0, cpu_booke_setup }, + { "Freescale e500mc core", FSL_E500mc, REVFMT_MAJMIN, + 0, cpu_booke_setup }, + { "Freescale e5500 core", FSL_E5500, REVFMT_MAJMIN, + 0, cpu_booke_setup }, { "IBM Cell Broadband Engine", IBMCELLBE, REVFMT_MAJMIN, PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, NULL}, @@ -191,6 +195,8 @@ cpu_setup(u_int cpuid) break; case FSL_E500v1: case FSL_E500v2: + case FSL_E500mc: + case FSL_E5500: maj = (pvr >> 4) & 0xf; min = (pvr >> 0) & 0xf; break; @@ -438,7 +444,7 @@ cpu_6xx_print_cacheinfo(u_int cpuid, uin } static void -cpu_e500_setup(int cpuid, uint16_t vers) +cpu_booke_setup(int cpuid, uint16_t vers) { register_t hid0; @@ -453,7 +459,7 @@ cpu_e500_setup(int cpuid, uint16_t vers)
svn commit: r236098 - head/sys/powerpc/booke
Author: raj Date: Sat May 26 13:42:55 2012 New Revision: 236098 URL: http://svn.freebsd.org/changeset/base/236098 Log: Retrieve CPU number info from the device tree. Obtained from:Freescale, Semihalf. Modified: head/sys/powerpc/booke/platform_bare.c Modified: head/sys/powerpc/booke/platform_bare.c == --- head/sys/powerpc/booke/platform_bare.c Sat May 26 13:36:18 2012 (r236097) +++ head/sys/powerpc/booke/platform_bare.c Sat May 26 13:42:55 2012 (r236098) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2008-2009 Semihalf, Rafal Jaworowski + * Copyright (c) 2008-2012 Semihalf. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -101,26 +101,16 @@ PLATFORM_DEF(bare_platform); static int bare_probe(platform_t plat) { - uint32_t ver, sr; + phandle_t cpus, child; + uint32_t sr; int i, law_max, tgt; - ver = SVR_VER(mfspr(SPR_SVR)); - switch (ver & ~0x0008) {/* Mask Security Enabled bit */ - case SVR_P4080: - maxcpu = 8; - break; - case SVR_P4040: - maxcpu = 4; - break; - case SVR_MPC8572: - case SVR_P1020: - case SVR_P2020: - maxcpu = 2; - break; - default: + if ((cpus = OF_finddevice("/cpus")) != 0) { + for (maxcpu = 0, child = OF_child(cpus); child != 0; + child = OF_peer(child), maxcpu++) + ; + } else maxcpu = 1; - break; - } /* * Clear local access windows. Skip DRAM entries, so we don't shoot ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r236119 - in head/sys: conf powerpc/mpc85xx powerpc/powerpc
Author: raj Date: Sat May 26 21:02:49 2012 New Revision: 236119 URL: http://svn.freebsd.org/changeset/base/236119 Log: Move OpenPIC FDT bus glue to a shared location, so that other PowerPC platforms can use it, not only MPC85XX. This is just reorg, no functional changes. Added: head/sys/powerpc/powerpc/openpic_fdt.c - copied unchanged from r236094, head/sys/powerpc/mpc85xx/openpic_fdt.c Deleted: head/sys/powerpc/mpc85xx/openpic_fdt.c Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc == --- head/sys/conf/files.powerpc Sat May 26 20:13:24 2012(r236118) +++ head/sys/conf/files.powerpc Sat May 26 21:02:49 2012(r236119) @@ -132,7 +132,6 @@ powerpc/mpc85xx/isa.c optionalmpc85xx powerpc/mpc85xx/lbc.c optionalmpc85xx powerpc/mpc85xx/mpc85xx.c optionalmpc85xx powerpc/mpc85xx/nexus.coptionalmpc85xx -powerpc/mpc85xx/openpic_fdt.c optionalfdt powerpc/mpc85xx/pci_fdt.c optionalpci mpc85xx powerpc/ofw/ofw_cpu.c optionalaim powerpc/ofw/ofw_machdep.c optionalaim @@ -194,6 +193,7 @@ powerpc/powerpc/mem.c optionalmem powerpc/powerpc/mmu_if.m standard powerpc/powerpc/mp_machdep.c optionalsmp powerpc/powerpc/openpic.c standard +powerpc/powerpc/openpic_fdt.c optionalfdt powerpc/powerpc/pic_if.m standard powerpc/powerpc/pmap_dispatch.cstandard powerpc/powerpc/platform.c standard Copied: head/sys/powerpc/powerpc/openpic_fdt.c (from r236094, head/sys/powerpc/mpc85xx/openpic_fdt.c) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powerpc/openpic_fdt.c Sat May 26 21:02:49 2012 (r236119, copy of r236094, head/sys/powerpc/mpc85xx/openpic_fdt.c) @@ -0,0 +1,93 @@ +/*- + * Copyright (c) 2009-2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under sponsorship from + * the FreeBSD Foundation. + * + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include "pic_if.h" + +static int openpic_fdt_probe(device_t); +static int openpic_fdt_attach(device_t); + +static device_method_t openpic_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, openpic_fdt_probe), + DEVMETHOD(device_attach,openpic_fdt_attach), + + /* PIC interface */ + DEVMETHOD(pic_bind, openpic_bind), + DEVMETHOD(pic_config, openpic_config), + DEVMETHOD(pic_dispatch, openpic_dispatch), + DEVMETHOD(pic_enable, openpic_enable), + DEVMETHOD(pic_eoi, openpic_eoi), + DEVMETHOD(pic_ipi, openpic_ipi), + DEVMETHOD(pic_mask, openpic_mask), + DEVMETHOD(pic_unmask, openpic_unmask), + + { 0, 0 }, +}; + +static driver_t openpic_fdt_driver = { + "openpic", + openpic_fdt_methods, + sizeof(struct openpic_softc) +}; + +DRIVER_MODULE(openpic, simplebus, openpic_fdt_driver, openpic_devclass, 0, 0); + +static int +openpic_fdt_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "chrp,open-pic")) + return (ENXIO); + + device_set_desc(dev, OPENPIC_DEVSTR); + return (BUS_PROBE_DEFAULT); +} + +static int +openpic_fdt_attach(device_t de
svn commit: r236120 - head/sys/dev/usb/controller
Author: raj Date: Sat May 26 21:05:11 2012 New Revision: 236120 URL: http://svn.freebsd.org/changeset/base/236120 Log: Import EHCI attachment driver for Freescale integrated controller. Obtained from:Freescale, Semihalf. Written by: Michal Dubiel Added: head/sys/dev/usb/controller/ehci_fsl.c (contents, props changed) Added: head/sys/dev/usb/controller/ehci_fsl.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/ehci_fsl.c Sat May 26 21:05:11 2012 (r236120) @@ -0,0 +1,423 @@ +/*- + * Copyright (c) 2010-2012 Semihalf + * All rights reserved. + * + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_bus.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include "opt_platform.h" + +/* + * Register the driver + */ +/* Forward declarations */ +static int fsl_ehci_attach(device_t self); +static int fsl_ehci_detach(device_t self); +static int fsl_ehci_probe(device_t self); + +static device_method_t ehci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, fsl_ehci_probe), + DEVMETHOD(device_attach, fsl_ehci_attach), + DEVMETHOD(device_detach, fsl_ehci_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + + { 0, 0 } +}; + +/* kobj_class definition */ +static driver_t ehci_driver = { + "ehci", + ehci_methods, + sizeof(struct ehci_softc) +}; + +static devclass_t ehci_devclass; + +DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); +MODULE_DEPEND(ehci, usb, 1, 1, 1); + +/* + * Private defines + */ +#define FSL_EHCI_REG_OFF 0x100 +#define FSL_EHCI_REG_SIZE 0x300 + +/* + * Internal interface registers' offsets. + * Offsets from 0x000 ehci dev space, big-endian access. + */ +enum internal_reg { + SNOOP1 = 0x400, + SNOOP2 = 0x404, + AGE_CNT_THRESH = 0x408, + SI_CTRL = 0x410, + CONTROL = 0x500 +}; + +/* CONTROL register bit flags */ +enum control_flags { + USB_EN = 0x0004, + UTMI_PHY_EN = 0x0200, + ULPI_INT_EN = 0x0001 +}; + +/* SI_CTRL register bit flags */ +enum si_ctrl_flags { + FETCH_32= 1, + FETCH_64= 0 +}; + +#define SNOOP_RANGE_2GB0x1E + +/* + * Operational registers' offsets. + * Offsets from USBCMD register, little-endian access. + */ +enum special_op_reg { + USBMODE = 0x0A8, + PORTSC = 0x084, + ULPI_VIEWPORT = 0x70 +}; + +/* USBMODE register bit flags */ +enum usbmode_flags { + HOST_MODE = 0x3, + DEVICE_MODE = 0x2 +}; + +#definePORT_POWER_MASK 0x1000 + +/* + * Private methods + */ + +static void +set_to_host_mode(ehci_softc_t *sc) +{ + int tmp; + + tmp = bus_space_read_4(sc->sc_io_tag, sc->sc_io_hdl, USBMODE); + bus_space_write_4(sc->sc_io_tag, sc->sc_io_hdl, USBMODE, tmp | HOST_MODE); +} + +static void +enable_usb(device_t dev, bus_space_tag_t iot, bus_space_handle_t ioh) +{ + int tmp; + phandle_t node; + char *phy_type; + + phy_type = NULL; + tm
svn commit: r236121 - head/sys/powerpc/mpc85xx
Author: raj Date: Sat May 26 21:07:15 2012 New Revision: 236121 URL: http://svn.freebsd.org/changeset/base/236121 Log: Import eSDHC driver for Freescale integrated controller. Obtained from:Freescale, Semihalf Written by: Michal Dubiel Added: head/sys/powerpc/mpc85xx/fsl_sdhc.c (contents, props changed) head/sys/powerpc/mpc85xx/fsl_sdhc.h (contents, props changed) Added: head/sys/powerpc/mpc85xx/fsl_sdhc.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/mpc85xx/fsl_sdhc.c Sat May 26 21:07:15 2012 (r236121) @@ -0,0 +1,1306 @@ +/*- + * Copyright (c) 2011-2012 Semihalf + * All rights reserved. + * + * 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. + */ + +/* + * Driver for Freescale integrated eSDHC controller. + * Limitations: + * - No support for multi-block transfers. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "opt_platform.h" + +#include "mmcbr_if.h" + +#include "fsl_sdhc.h" + +#define DEBUG +#undef DEBUG +#ifdef DEBUG +#defineDPRINTF(fmt, arg...)printf("DEBUG %s(): " fmt, __FUNCTION__, ##arg) +#else +#defineDPRINTF(fmt, arg...) +#endif + + +/* + * Register the driver + */ +/* Forward declarations */ +static int fsl_sdhc_probe(device_t); +static int fsl_sdhc_attach(device_t); +static int fsl_sdhc_detach(device_t); + +static int fsl_sdhc_read_ivar(device_t, device_t, int, uintptr_t *); +static int fsl_sdhc_write_ivar(device_t, device_t, int, uintptr_t); + +static int fsl_sdhc_update_ios(device_t, device_t); +static int fsl_sdhc_request(device_t, device_t, struct mmc_request *); +static int fsl_sdhc_get_ro(device_t, device_t); +static int fsl_sdhc_acquire_host(device_t, device_t); +static int fsl_sdhc_release_host(device_t, device_t); + +static device_method_t fsl_sdhc_methods[] = { + /* device_if */ + DEVMETHOD(device_probe, fsl_sdhc_probe), + DEVMETHOD(device_attach, fsl_sdhc_attach), + DEVMETHOD(device_detach, fsl_sdhc_detach), + + /* Bus interface */ + DEVMETHOD(bus_read_ivar, fsl_sdhc_read_ivar), + DEVMETHOD(bus_write_ivar, fsl_sdhc_write_ivar), + + /* OFW bus interface */ + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model,ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + /* mmcbr_if */ + DEVMETHOD(mmcbr_update_ios, fsl_sdhc_update_ios), + DEVMETHOD(mmcbr_request, fsl_sdhc_request), + DEVMETHOD(mmcbr_get_ro, fsl_sdhc_get_ro), + DEVMETHOD(mmcbr_acquire_host, fsl_sdhc_acquire_host), + DEVMETHOD(mmcbr_release_host, fsl_sdhc_release_host), + + {0, 0}, +}; + +/* kobj_class definition */ +static driver_t fsl_sdhc_driver = { + "sdhci", + fsl_sdhc_methods, + sizeof(struct fsl_sdhc_softc) +}; + +static devclass_t fsl_sdhc_devclass; + +DRIVER_MODULE(sdhci, simplebus, fsl_sdhc_driver, fsl_sdhc_devclass, 0, 0); + + +/* + * Private methods + ***
svn commit: r236141 - in head/sys: conf kern powerpc/booke powerpc/conf powerpc/include powerpc/powerpc
Author: raj Date: Sun May 27 10:25:20 2012 New Revision: 236141 URL: http://svn.freebsd.org/changeset/base/236141 Log: Let us manage differences of Book-E PowerPC variations i.e. vendor / implementation specific vs. the common architecture definition. Bring PPC4XX defines (PSL, SPR, TLB). Note the new definitions under BOOKE_PPC4XX are not used in the code yet. This change set is not supposed to affect existing E500 support, it's just another reorg step before bringing support for E500mc, E5500 and PPC465. Obtained from:AppliedMicro, Freescale, Semihalf Modified: head/sys/conf/files.powerpc head/sys/conf/options.powerpc head/sys/kern/sched_ule.c head/sys/powerpc/booke/locore.S head/sys/powerpc/booke/machdep.c head/sys/powerpc/conf/MPC85XX head/sys/powerpc/conf/NOTES head/sys/powerpc/include/pcpu.h head/sys/powerpc/include/profile.h head/sys/powerpc/include/psl.h head/sys/powerpc/include/pte.h head/sys/powerpc/include/spr.h head/sys/powerpc/include/tlb.h head/sys/powerpc/include/trap.h head/sys/powerpc/include/vmparam.h head/sys/powerpc/powerpc/cpu.c head/sys/powerpc/powerpc/db_trace.c head/sys/powerpc/powerpc/gdb_machdep.c head/sys/powerpc/powerpc/genassym.c Modified: head/sys/conf/files.powerpc == --- head/sys/conf/files.powerpc Sun May 27 09:34:47 2012(r236140) +++ head/sys/conf/files.powerpc Sun May 27 10:25:20 2012(r236141) @@ -97,17 +97,17 @@ powerpc/aim/swtch64.S optionalaim powe powerpc/aim/trap.c optionalaim powerpc/aim/uma_machdep.c optionalaim powerpc/aim/vm_machdep.c optionalaim -powerpc/booke/clock.c optionale500 -powerpc/booke/copyinout.c optionale500 -powerpc/booke/interrupt.c optionale500 -powerpc/booke/locore.S optionale500 no-obj -powerpc/booke/machdep.coptionale500 -powerpc/booke/mp_cpudep.c optionale500 smp +powerpc/booke/clock.c optionalbooke +powerpc/booke/copyinout.c optionalbooke +powerpc/booke/interrupt.c optionalbooke +powerpc/booke/locore.S optionalbooke no-obj +powerpc/booke/machdep.coptionalbooke +powerpc/booke/mp_cpudep.c optionalbooke smp powerpc/booke/platform_bare.c optionalmpc85xx -powerpc/booke/pmap.c optionale500 -powerpc/booke/swtch.S optionale500 -powerpc/booke/trap.c optionale500 -powerpc/booke/vm_machdep.c optionale500 +powerpc/booke/pmap.c optionalbooke +powerpc/booke/swtch.S optionalbooke +powerpc/booke/trap.c optionalbooke +powerpc/booke/vm_machdep.c optionalbooke powerpc/cpufreq/dfs.c optionalcpufreq powerpc/cpufreq/pcr.c optionalcpufreq aim powerpc/fpu/fpu_add.c optionalfpu_emu powerpc Modified: head/sys/conf/options.powerpc == --- head/sys/conf/options.powerpc Sun May 27 09:34:47 2012 (r236140) +++ head/sys/conf/options.powerpc Sun May 27 10:25:20 2012 (r236141) @@ -2,7 +2,9 @@ # Options specific to the powerpc platform kernels AIMopt_global.h -E500 opt_global.h +BOOKE opt_global.h +BOOKE_E500 opt_global.h +BOOKE_PPC4XX opt_global.h CELL POWERPC Modified: head/sys/kern/sched_ule.c == --- head/sys/kern/sched_ule.c Sun May 27 09:34:47 2012(r236140) +++ head/sys/kern/sched_ule.c Sun May 27 10:25:20 2012(r236141) @@ -77,7 +77,7 @@ dtrace_vtime_switch_func_tdtrace_vtime_ #include #include -#if defined(__powerpc__) && defined(E500) +#if defined(__powerpc__) && defined(BOOKE_E500) #error "This architecture is not currently compatible with ULE" #endif Modified: head/sys/powerpc/booke/locore.S == --- head/sys/powerpc/booke/locore.S Sun May 27 09:34:47 2012 (r236140) +++ head/sys/powerpc/booke/locore.S Sun May 27 10:25:20 2012 (r236141) @@ -218,7 +218,7 @@ done_mapping: mr %r3, %r30 mr %r4, %r31 - /* Prepare e500 core */ + /* Prepare core */ bl booke_init /* Switch to thread0.td_kstack now */ Modified: head/sys/powerpc/booke/machdep.c == --- head/sys/powerpc/booke/machdep.cSun May 27 09:34:47 2012 (r236140) +++ head/sys/powerpc/booke/machdep.cSun May 27 10:25:20 2012 (r236141) @@ -392,6 +392,7 @@ booke_init
svn commit: r236142 - head/sys/powerpc/booke
Author: raj Date: Sun May 27 10:32:10 2012 New Revision: 236142 URL: http://svn.freebsd.org/changeset/base/236142 Log: Remove redundant check, we catch ULE platform support in common sys/kern/sched_ule.c Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c == --- head/sys/powerpc/booke/pmap.c Sun May 27 10:25:20 2012 (r236141) +++ head/sys/powerpc/booke/pmap.c Sun May 27 10:32:10 2012 (r236142) @@ -101,10 +101,6 @@ __FBSDID("$FreeBSD$"); #define TODO panic("%s: not implemented", __func__); -#include "opt_sched.h" -#ifndef SCHED_4BSD -#error "e500 only works with SCHED_4BSD which uses a global scheduler lock." -#endif extern struct mtx sched_lock; extern int dumpsys_minidump; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r236324 - in head/sys: conf powerpc/booke powerpc/include
Author: raj Date: Wed May 30 17:34:40 2012 New Revision: 236324 URL: http://svn.freebsd.org/changeset/base/236324 Log: Extract vendor specific Book-E pieces into separate files and have a common skeleton (maybe we should kobj-tize this one day). Note the PPC4xx bit is not connected to the build yet. Obtained from:AppliedMicro, Semihalf. Added: head/sys/powerpc/booke/machdep_e500.c (contents, props changed) head/sys/powerpc/booke/machdep_ppc4xx.c (contents, props changed) head/sys/powerpc/include/machdep.h (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/booke/machdep.c Modified: head/sys/conf/files.powerpc == --- head/sys/conf/files.powerpc Wed May 30 17:07:50 2012(r236323) +++ head/sys/conf/files.powerpc Wed May 30 17:34:40 2012(r236324) @@ -102,6 +102,7 @@ powerpc/booke/copyinout.c optionalbooke powerpc/booke/interrupt.c optionalbooke powerpc/booke/locore.S optionalbooke no-obj powerpc/booke/machdep.coptionalbooke +powerpc/booke/machdep_e500.c optionalbooke_e500 powerpc/booke/mp_cpudep.c optionalbooke smp powerpc/booke/platform_bare.c optionalmpc85xx powerpc/booke/pmap.c optionalbooke Modified: head/sys/powerpc/booke/machdep.c == --- head/sys/powerpc/booke/machdep.cWed May 30 17:07:50 2012 (r236323) +++ head/sys/powerpc/booke/machdep.cWed May 30 17:34:40 2012 (r236324) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2006 Semihalf, Marian Balakowicz + * Copyright (C) 2006-2012 Semihalf * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -129,6 +129,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -138,8 +139,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #ifdef DDB extern vm_offset_t ksym_start, ksym_end; #endif @@ -158,11 +157,6 @@ extern unsigned char __sbss_start[]; extern unsigned char __sbss_end[]; extern unsigned char _end[]; -extern void dcache_enable(void); -extern void dcache_inval(void); -extern void icache_enable(void); -extern void icache_inval(void); - /* * Bootinfo is passed to us by legacy loaders. Save the address of the * structure to handle backward compatibility. @@ -286,7 +280,6 @@ booke_init(uint32_t arg1, uint32_t arg2) struct pcpu *pc; void *kmdp, *mdp; vm_offset_t dtbp, end; - uint32_t csr; kmdp = NULL; @@ -359,9 +352,9 @@ booke_init(uint32_t arg1, uint32_t arg2) while (1); OF_interpret("perform-fixup", 0); - - /* Initialize TLB1 handling */ - tlb1_init(fdt_immr_pa); + + /* Set up TLB initially */ + booke_init_tlb(fdt_immr_pa); /* Reset Time Base */ mttb(0); @@ -396,10 +389,6 @@ booke_init(uint32_t arg1, uint32_t arg2) debugf(" HID0 = 0x%08x\n", mfspr(SPR_HID0)); debugf(" HID1 = 0x%08x\n", mfspr(SPR_HID1)); debugf(" BUCSR = 0x%08x\n", mfspr(SPR_BUCSR)); - - __asm __volatile("msync; isync"); - csr = ccsr_read4(OCP85XX_L2CTL); - debugf(" L2CTL = 0x%08x\n", csr); #endif debugf(" dtbp = 0x%08x\n", (uint32_t)dtbp); @@ -447,29 +436,8 @@ booke_init(uint32_t arg1, uint32_t arg2) mtmsr(mfmsr() | PSL_ME); isync(); - /* Enable D-cache if applicable */ - csr = mfspr(SPR_L1CSR0); - if ((csr & L1CSR0_DCE) == 0) { - dcache_inval(); - dcache_enable(); - } - - csr = mfspr(SPR_L1CSR0); - if ((boothowto & RB_VERBOSE) != 0 || (csr & L1CSR0_DCE) == 0) - printf("L1 D-cache %sabled\n", - (csr & L1CSR0_DCE) ? "en" : "dis"); - - /* Enable L1 I-cache if applicable. */ - csr = mfspr(SPR_L1CSR1); - if ((csr & L1CSR1_ICE) == 0) { - icache_inval(); - icache_enable(); - } - - csr = mfspr(SPR_L1CSR1); - if ((boothowto & RB_VERBOSE) != 0 || (csr & L1CSR1_ICE) == 0) - printf("L1 I-cache %sabled\n", - (csr & L1CSR1_ICE) ? "en" : "dis"); + /* Enable L1 caches */ + booke_enable_l1_cache(); debugf("%s: SP = 0x%08x\n", __func__, ((uintptr_t)thread0.td_pcb - 16) & ~15); Added: head/sys/powerpc/booke/machdep_e500.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/booke/machdep_e500.c Wed May 30 17:34:40 2012 (r236324) @@ -0,0 +1,158 @@ +/*- + * Copyright (c) 2011-2012 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modif
svn commit: r236325 - head/sys/powerpc/booke
Author: raj Date: Wed May 30 18:05:48 2012 New Revision: 236325 URL: http://svn.freebsd.org/changeset/base/236325 Log: Panic openly if we cannot retrieve memory information from the device tree. This is a critical condition and can lead to all sorts of misterious hangs if not handled. Obtained from:Semihalf Also reported by: thompsa Modified: head/sys/powerpc/booke/platform_bare.c Modified: head/sys/powerpc/booke/platform_bare.c == --- head/sys/powerpc/booke/platform_bare.c Wed May 30 17:34:40 2012 (r236324) +++ head/sys/powerpc/booke/platform_bare.c Wed May 30 18:05:48 2012 (r236325) @@ -76,7 +76,7 @@ static int bare_smp_start_cpu(platform_t static void booke_reset(platform_t); static platform_method_t bare_methods[] = { - PLATFORMMETHOD(platform_probe, bare_probe), + PLATFORMMETHOD(platform_probe, bare_probe), PLATFORMMETHOD(platform_mem_regions,bare_mem_regions), PLATFORMMETHOD(platform_timebase_freq, bare_timebase_freq), @@ -143,9 +143,9 @@ bare_mem_regions(platform_t plat, struct int i, rv; rv = fdt_get_mem_regions(avail_regions, availsz, &memsize); - if (rv != 0) - return; + panic("%s: could not retrieve mem regions from the 'memory' " + "node, error: %d", __func__, rv); for (i = 0; i < *availsz; i++) { if (avail_regions[i].mr_start < 1048576) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r234558 - in stable/9/sys: boot/fdt boot/uboot/common i386/conf kern
Author: raj Date: Sat Apr 21 20:10:26 2012 New Revision: 234558 URL: http://svn.freebsd.org/changeset/base/234558 Log: MFC r233230, r233323: Improve device tree blob (DTB) handling in loader(8). Enable using the statically embedded blob from the kernel, if present. The KLD loaded DTB takes precedence, but they are both recognized and handled in the same way. Improve FDT handling in loader(8) and make it more robust. o Fix buffer overflows when using a long property body in node paths. o Fix loop end condition when iterating through the symbol table. o Better error handling during node modification, better problem reporting. o Eliminate build time warnings. Submitted by: Lukasz Wojcik Obtained from: Semihalf Modified: stable/9/sys/boot/fdt/fdt_loader_cmd.c stable/9/sys/boot/uboot/common/metadata.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) stable/9/sys/kern/subr_witness.c (props changed) Modified: stable/9/sys/boot/fdt/fdt_loader_cmd.c == --- stable/9/sys/boot/fdt/fdt_loader_cmd.c Sat Apr 21 19:22:53 2012 (r234557) +++ stable/9/sys/boot/fdt/fdt_loader_cmd.c Sat Apr 21 20:10:26 2012 (r234558) @@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include "bootstrap.h" #include "glue.h" @@ -54,7 +57,9 @@ __FBSDID("$FreeBSD$"); #define STR(number) #number #define STRINGIFY(number) STR(number) -#define MIN(num1, num2)(((num1) < (num2)) ? (num1):(num2)) +#define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l) + +#define FDT_STATIC_DTB_SYMBOL "fdt_static_dtb" static struct fdt_header *fdtp = NULL; @@ -92,6 +97,91 @@ static const struct cmdtab commands[] = static char cwd[FDT_CWD_LEN] = "/"; +static vm_offset_t +fdt_find_static_dtb(void) +{ + Elf_Sym sym; + vm_offset_t dyntab, esym; + uint64_t offs; + struct preloaded_file *kfp; + struct file_metadata *md; + Elf_Sym *symtab; + Elf_Dyn *dyn; + char *strtab, *strp; + int i, sym_count; + + symtab = NULL; + dyntab = esym = 0; + strtab = strp = NULL; + + offs = __elfN(relocation_offset); + + kfp = file_findfile(NULL, NULL); + if (kfp == NULL) + return (0); + + md = file_findmetadata(kfp, MODINFOMD_ESYM); + if (md == NULL) + return (0); + COPYOUT(md->md_data, &esym, sizeof(esym)); + + md = file_findmetadata(kfp, MODINFOMD_DYNAMIC); + if (md == NULL) + return (0); + COPYOUT(md->md_data, &dyntab, sizeof(dyntab)); + + dyntab += offs; + + /* Locate STRTAB and DYNTAB */ + for (dyn = (Elf_Dyn *)dyntab; dyn->d_tag != DT_NULL; dyn++) { + if (dyn->d_tag == DT_STRTAB) { + strtab = (char *)(uintptr_t)(dyn->d_un.d_ptr + offs); + continue; + } else if (dyn->d_tag == DT_SYMTAB) { + symtab = (Elf_Sym *)(uintptr_t) + (dyn->d_un.d_ptr + offs); + continue; + } + } + + if (symtab == NULL || strtab == NULL) { + /* +* No symtab? No strtab? That should not happen here, +* and should have been verified during __elfN(loadimage). +* This must be some kind of a bug. +*/ + return (0); + } + + sym_count = (int)((Elf_Sym *)esym - symtab) / sizeof(Elf_Sym); + + /* +* The most efficent way to find a symbol would be to calculate a +* hash, find proper bucket and chain, and thus find a symbol. +* However, that would involve code duplication (e.g. for hash +* function). So we're using simpler and a bit slower way: we're +* iterating through symbols, searching for the one which name is +* 'equal' to 'fdt_static_dtb'. To speed up the process a little bit, +* we are eliminating symbols type of which is not STT_NOTYPE, or(and) +* those which binding attribute is not STB_G
svn commit: r234559 - in stable/9/sys: arm/conf arm/mv boot/fdt/dts dev/cesa i386/conf kern
Author: raj Date: Sat Apr 21 20:22:02 2012 New Revision: 234559 URL: http://svn.freebsd.org/changeset/base/234559 Log: MFC r227730: Initial version of cesa(4) driver for Marvell crypto engine and security accelerator. The following algorithms and schemes are supported: - 3DES, AES, DES - MD5, SHA1 Obtained from: Semihalf Written by: Piotr Ziecik Added: stable/9/sys/dev/cesa/ - copied from r227730, head/sys/dev/cesa/ Modified: stable/9/sys/arm/conf/DB-88F6XXX stable/9/sys/arm/conf/SHEEVAPLUG stable/9/sys/arm/mv/files.mv stable/9/sys/boot/fdt/dts/db88f6281.dts stable/9/sys/boot/fdt/dts/sheevaplug.dts Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) stable/9/sys/kern/subr_witness.c (props changed) Modified: stable/9/sys/arm/conf/DB-88F6XXX == --- stable/9/sys/arm/conf/DB-88F6XXXSat Apr 21 20:10:26 2012 (r234558) +++ stable/9/sys/arm/conf/DB-88F6XXXSat Apr 21 20:22:02 2012 (r234559) @@ -66,6 +66,10 @@ device mii device e1000phy device bpf +device cesa# Marvell security engine +device crypto +device cryptodev + # USB optionsUSB_DEBUG # enable debug msgs device usb Modified: stable/9/sys/arm/conf/SHEEVAPLUG == --- stable/9/sys/arm/conf/SHEEVAPLUGSat Apr 21 20:10:26 2012 (r234558) +++ stable/9/sys/arm/conf/SHEEVAPLUGSat Apr 21 20:22:02 2012 (r234559) @@ -60,6 +60,10 @@ options HZ=1000 optionsDEVICE_POLLING device vlan +device cesa# Marvell security engine +device crypto +device cryptodev + # USB optionsUSB_DEBUG # enable debug msgs device usb Modified: stable/9/sys/arm/mv/files.mv == --- stable/9/sys/arm/mv/files.mvSat Apr 21 20:10:26 2012 (r234558) +++ stable/9/sys/arm/mv/files.mvSat Apr 21 20:22:02 2012 (r234559) @@ -28,6 +28,7 @@ arm/mv/mv_sata.c optionalata | atamvsa arm/mv/timer.c standard arm/mv/twsi.c optionaliicbus +dev/cesa/cesa.coptionalcesa dev/mge/if_mge.c optionalmge dev/mvs/mvs_soc.c optionalmvs dev/uart/uart_dev_ns8250.c optionaluart Modified: stable/9/sys/boot/fdt/dts/db88f6281.dts == --- stable/9/sys/boot/fdt/dts/db88f6281.dts Sat Apr 21 20:10:26 2012 (r234558) +++ stable/9/sys/boot/fdt/dts/db88f6281.dts Sat Apr 21 20:22:02 2012 (r234559) @@ -239,6 +239,8 @@ reg = <0x3 0x1>; interrupts = <22>; interrupt-parent = <&PIC>; + + sram-handle = <&SRAM>; }; usb@5 { Modified: stable/9/sys/boot/fdt/dts/sheevaplug.dts == --- stable/9/sys/boot/fdt/dts/sheevaplug.dtsSat Apr 21 20:10:26 2012 (r234558) +++ stable/9/sys/boot/fdt/dts/sheevaplug.dtsSat Apr 21 20:22:02 2012 (r234559) @@ -236,6 +236,8 @@ reg = <0x3 0x1>; interrupts = <22>; interrupt-parent = <&PIC>; + + sram-handle = <&SRAM>; }; usb@5 { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r239998 - head/contrib/dtc
On 2012-09-02, at 03:48, Andrew Turner wrote: > Author: andrew > Date: Sun Sep 2 01:48:47 2012 > New Revision: 239998 > URL: http://svn.freebsd.org/changeset/base/239998 > > Log: > Fix a logic inversion in an assert to allow us to use dts files that > include other files. > > Modified: > head/contrib/dtc/dtc-lexer.l Is this a bug in the dtc that should be upstreamed perhaps, or is it fixed at the point beyond our recent import of the vendor package? Rafal ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188711 - in head/sys: dev/tsec powerpc/conf
Author: raj Date: Tue Feb 17 14:57:05 2009 New Revision: 188711 URL: http://svn.freebsd.org/changeset/base/188711 Log: Additional features for the tsec(4) Ethernet driver. - interrupt coalescing - polling - jumbo frames - multicast - VLAN tagging The enhanced version of the chip (eTSEC) can also take advantage of: - TCP/IP checksum calculation h/w offloading Obtained from:Freescale, Semihalf Modified: head/sys/dev/tsec/if_tsec.c head/sys/dev/tsec/if_tsec.h head/sys/dev/tsec/if_tsec_ocp.c head/sys/dev/tsec/if_tsecreg.h head/sys/powerpc/conf/MPC85XX Modified: head/sys/dev/tsec/if_tsec.c == --- head/sys/dev/tsec/if_tsec.c Tue Feb 17 11:55:50 2009(r188710) +++ head/sys/dev/tsec/if_tsec.c Tue Feb 17 14:57:05 2009(r188711) @@ -30,6 +30,10 @@ #include __FBSDID("$FreeBSD$"); +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_device_polling.h" +#endif + #include #include #include @@ -50,6 +54,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include + #include #include @@ -62,7 +70,8 @@ static inttsec_alloc_dma_desc(device_t bus_dmamap_t *dmap, bus_size_t dsize, void **vaddr, void *raddr, const char *dname); static voidtsec_dma_ctl(struct tsec_softc *sc, int state); -static int tsec_encap(struct tsec_softc *sc, struct mbuf *m_head); +static int tsec_encap(struct tsec_softc *sc, struct mbuf *m_head, +int fcb_inserted); static voidtsec_free_dma(struct tsec_softc *sc); static voidtsec_free_dma_desc(bus_dma_tag_t dtag, bus_dmamap_t dmap, void *vaddr); static int tsec_ifmedia_upd(struct ifnet *ifp); @@ -83,6 +92,19 @@ static void tsec_start_locked(struct ifn static voidtsec_stop(struct tsec_softc *sc); static voidtsec_tick(void *arg); static voidtsec_watchdog(struct tsec_softc *sc); +static voidtsec_add_sysctls(struct tsec_softc *sc); +static int tsec_sysctl_ic_time(SYSCTL_HANDLER_ARGS); +static int tsec_sysctl_ic_count(SYSCTL_HANDLER_ARGS); +static voidtsec_set_rxic(struct tsec_softc *sc); +static voidtsec_set_txic(struct tsec_softc *sc); +static voidtsec_receive_intr_locked(struct tsec_softc *sc, int count); +static voidtsec_transmit_intr_locked(struct tsec_softc *sc); +static voidtsec_error_intr_locked(struct tsec_softc *sc, int count); +static voidtsec_offload_setup(struct tsec_softc *sc); +static voidtsec_offload_process_frame(struct tsec_softc *sc, +struct mbuf *m); +static voidtsec_setup_multicast(struct tsec_softc *sc); +static int tsec_set_mtu(struct tsec_softc *sc, unsigned int mtu); struct tsec_softc *tsec0_sc = NULL; /* XXX ugly hack! */ @@ -113,18 +135,28 @@ tsec_attach(struct tsec_softc *sc) /* Disable interrupts for now */ tsec_intrs_ctl(sc, 0); + /* Configure defaults for interrupts coalescing */ + sc->rx_ic_time = 768; + sc->rx_ic_count = 16; + sc->tx_ic_time = 768; + sc->tx_ic_count = 16; + tsec_set_rxic(sc); + tsec_set_txic(sc); + tsec_add_sysctls(sc); + /* Allocate a busdma tag and DMA safe memory for TX descriptors. */ - error = tsec_alloc_dma_desc(sc->dev, &sc->tsec_tx_dtag, &sc->tsec_tx_dmap, - sizeof(*sc->tsec_tx_vaddr) * TSEC_TX_NUM_DESC, + error = tsec_alloc_dma_desc(sc->dev, &sc->tsec_tx_dtag, + &sc->tsec_tx_dmap, sizeof(*sc->tsec_tx_vaddr) * TSEC_TX_NUM_DESC, (void **)&sc->tsec_tx_vaddr, &sc->tsec_tx_raddr, "TX"); + if (error) { tsec_detach(sc); return (ENXIO); } /* Allocate a busdma tag and DMA safe memory for RX descriptors. */ - error = tsec_alloc_dma_desc(sc->dev, &sc->tsec_rx_dtag, &sc->tsec_rx_dmap, - sizeof(*sc->tsec_rx_vaddr) * TSEC_RX_NUM_DESC, + error = tsec_alloc_dma_desc(sc->dev, &sc->tsec_rx_dtag, + &sc->tsec_rx_dmap, sizeof(*sc->tsec_rx_vaddr) * TSEC_RX_NUM_DESC, (void **)&sc->tsec_rx_vaddr, &sc->tsec_rx_raddr, "RX"); if (error) { tsec_detach(sc); @@ -213,7 +245,7 @@ tsec_attach(struct tsec_softc *sc) ifp->if_softc = sc; if_initname(ifp, device_get_name(sc->dev), device_get_unit(sc->dev)); ifp->if_mtu = ETHERMTU; - ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST; + ifp->if_flags = IFF_SIMPLEX | IFF_MULTICAST | IFF_BROADCAST; ifp->if_init = tsec_init; ifp->if_start = tsec_start; ifp->if_ioctl = tsec_ioctl; @@ -222,10 +254,17 @@ tsec_attach(struct tsec_softc *sc) ifp->if_snd.ifq_drv_maxlen = TSEC_TX_NUM_DESC - 1; IFQ_SET_READY(&ifp->if_snd); - /* XXX No special features of TSEC are supported currently */ - ifp->if_capabilities = 0; + ifp->if_capabilities = IFCAP_VLAN_MTU; + if (sc->is_etsec) + ifp->if_capabilities |
svn commit: r188712 - head/sys/dev/tsec
Author: raj Date: Tue Feb 17 14:59:47 2009 New Revision: 188712 URL: http://svn.freebsd.org/changeset/base/188712 Log: tsec(4) style improvements and clean-up. Modified: head/sys/dev/tsec/if_tsec.c head/sys/dev/tsec/if_tsec.h head/sys/dev/tsec/if_tsec_ocp.c Modified: head/sys/dev/tsec/if_tsec.c == --- head/sys/dev/tsec/if_tsec.c Tue Feb 17 14:57:05 2009(r188711) +++ head/sys/dev/tsec/if_tsec.c Tue Feb 17 14:59:47 2009(r188712) @@ -165,34 +165,36 @@ tsec_attach(struct tsec_softc *sc) /* Allocate a busdma tag for TX mbufs. */ error = bus_dma_tag_create(NULL,/* parent */ - TSEC_TXBUFFER_ALIGNMENT, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filtfunc, filtfuncarg */ - MCLBYTES * (TSEC_TX_NUM_DESC - 1),/* maxsize */ - TSEC_TX_NUM_DESC - 1, /* nsegments */ - MCLBYTES, 0,/* maxsegsz, flags */ - NULL, NULL, /* lockfunc, lockfuncarg */ - &sc->tsec_tx_mtag); /* dmat */ + TSEC_TXBUFFER_ALIGNMENT, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filtfunc, filtfuncarg */ + MCLBYTES * (TSEC_TX_NUM_DESC - 1), /* maxsize */ + TSEC_TX_NUM_DESC - 1, /* nsegments */ + MCLBYTES, 0,/* maxsegsz, flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &sc->tsec_tx_mtag); /* dmat */ if (error) { - device_printf(sc->dev, "failed to allocate busdma tag(tx mbufs)\n"); + device_printf(sc->dev, "failed to allocate busdma tag " + "(tx mbufs)\n"); tsec_detach(sc); return (ENXIO); } /* Allocate a busdma tag for RX mbufs. */ error = bus_dma_tag_create(NULL,/* parent */ - TSEC_RXBUFFER_ALIGNMENT, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filtfunc, filtfuncarg */ - MCLBYTES, /* maxsize */ - 1, /* nsegments */ - MCLBYTES, 0,/* maxsegsz, flags */ - NULL, NULL, /* lockfunc, lockfuncarg */ - &sc->tsec_rx_mtag); /* dmat */ + TSEC_RXBUFFER_ALIGNMENT, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filtfunc, filtfuncarg */ + MCLBYTES, /* maxsize */ + 1, /* nsegments */ + MCLBYTES, 0,/* maxsegsz, flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &sc->tsec_rx_mtag); /* dmat */ if (error) { - device_printf(sc->dev, "failed to allocate busdma tag(rx mbufs)\n"); + device_printf(sc->dev, "failed to allocate busdma tag " + "(rx mbufs)\n"); tsec_detach(sc); return (ENXIO); } @@ -213,7 +215,8 @@ tsec_attach(struct tsec_softc *sc) /* Create RX busdma maps and zero mbuf handlers */ for (i = 0; i < TSEC_RX_NUM_DESC; i++) { - error = bus_dmamap_create(sc->tsec_rx_mtag, 0, &sc->rx_data[i].map); + error = bus_dmamap_create(sc->tsec_rx_mtag, 0, + &sc->rx_data[i].map); if (error) { device_printf(sc->dev, "failed to init RX ring\n"); tsec_detach(sc); @@ -227,8 +230,8 @@ tsec_attach(struct tsec_softc *sc) error = tsec_new_rxbuf(sc->tsec_rx_mtag, sc->rx_data[i].map, &sc->rx_data[i].mbuf, &sc->rx_data[i].paddr); if (error) { - device_printf(sc->dev, "can't load rx DMA map %d, error = " - "%d\n", i, error); + device_printf(sc->dev, "can't load rx DMA map %d, " + "error = %d\n", i, error); tsec_detach(sc); return (error); } @@ -354,9 +357,7 @@ tsec_init_locked(struct tsec_softc *sc) struct tsec_des
svn commit: r188713 - head/sys/dev/tsec
Author: raj Date: Tue Feb 17 15:39:16 2009 New Revision: 188713 URL: http://svn.freebsd.org/changeset/base/188713 Log: Handle mbuf exhaustion scenario in tsec(4). Without this fix the system would hang under heavy networking load. Submitted by: Leon Theunissen leon ! parsec dot co dot za Modified: head/sys/dev/tsec/if_tsec.c Modified: head/sys/dev/tsec/if_tsec.c == --- head/sys/dev/tsec/if_tsec.c Tue Feb 17 14:59:47 2009(r188712) +++ head/sys/dev/tsec/if_tsec.c Tue Feb 17 15:39:16 2009(r188713) @@ -1332,7 +1332,12 @@ tsec_receive_intr_locked(struct tsec_sof if (tsec_new_rxbuf(sc->tsec_rx_mtag, rx_data[i].map, &rx_data[i].mbuf, &rx_data[i].paddr)) { ifp->if_ierrors++; - continue; + /* +* We ran out of mbufs; didn't consume current +* descriptor and have to return it to the queue. +*/ + TSEC_BACK_CUR_RX_DESC(sc); + break; } /* Attach new buffer to descriptor and clear flags */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188715 - head/sys/dev/tsec
Author: raj Date: Tue Feb 17 15:47:13 2009 New Revision: 188715 URL: http://svn.freebsd.org/changeset/base/188715 Log: tsec(4): do not clear interrupt events register before use. Prior to this fix, IEVENT register was always cleared before calling tsec_error_intr_locked(), which prevented error recovery actions from happening with polling enabled (and could lead to serious problems, including controller hang). Submitted by: Marcin Ligenza marcinl ! pacomp dot com dot pl Modified: head/sys/dev/tsec/if_tsec.c Modified: head/sys/dev/tsec/if_tsec.c == --- head/sys/dev/tsec/if_tsec.c Tue Feb 17 15:41:41 2009(r188714) +++ head/sys/dev/tsec/if_tsec.c Tue Feb 17 15:47:13 2009(r188715) @@ -870,11 +870,11 @@ tsec_poll(struct ifnet *ifp, enum poll_c } if (cmd == POLL_AND_CHECK_STATUS) { - ie = TSEC_READ(sc, TSEC_REG_IEVENT); + tsec_error_intr_locked(sc, count); /* Clear all events reported */ + ie = TSEC_READ(sc, TSEC_REG_IEVENT); TSEC_WRITE(sc, TSEC_REG_IEVENT, ie); - tsec_error_intr_locked(sc, count); } tsec_transmit_intr_locked(sc); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188718 - head/sys/dev/tsec
Author: raj Date: Tue Feb 17 15:59:27 2009 New Revision: 188718 URL: http://svn.freebsd.org/changeset/base/188718 Log: tsec(4): Always try to resume the receiver. This helps recover from RX stall under heavy loads. Submitted by: Piotr Ziecik kosmo ! semihalf dot com Modified: head/sys/dev/tsec/if_tsec.c Modified: head/sys/dev/tsec/if_tsec.c == --- head/sys/dev/tsec/if_tsec.c Tue Feb 17 15:58:42 2009(r188717) +++ head/sys/dev/tsec/if_tsec.c Tue Feb 17 15:59:27 2009(r188718) @@ -1363,6 +1363,16 @@ tsec_receive_intr_locked(struct tsec_sof bus_dmamap_sync(sc->tsec_rx_dtag, sc->tsec_rx_dmap, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + + /* +* Make sure TSEC receiver is not halted. +* +* Various conditions can stop the TSEC receiver, but not all are +* signaled and handled by error interrupt, so make sure the receiver +* is running. Writing to TSEC_REG_RSTAT restarts the receiver when +* halted, and is harmless if already running. +*/ + TSEC_WRITE(sc, TSEC_REG_RSTAT, TSEC_RSTAT_QHLT); } void @@ -1507,9 +1517,6 @@ tsec_error_intr_locked(struct tsec_softc /* Get data from RX buffers */ tsec_receive_intr_locked(sc, count); - - /* Make receiver again active */ - TSEC_WRITE(sc, TSEC_REG_RSTAT, TSEC_RSTAT_QHLT); } if (ifp->if_flags & IFF_DEBUG) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188719 - head/sys/dev/tsec
Author: raj Date: Tue Feb 17 16:02:45 2009 New Revision: 188719 URL: http://svn.freebsd.org/changeset/base/188719 Log: tsec(4) cosmetics. Modified: head/sys/dev/tsec/if_tsec.c Modified: head/sys/dev/tsec/if_tsec.c == --- head/sys/dev/tsec/if_tsec.c Tue Feb 17 15:59:27 2009(r188718) +++ head/sys/dev/tsec/if_tsec.c Tue Feb 17 16:02:45 2009(r188719) @@ -968,7 +968,7 @@ tsec_ioctl(struct ifnet *ifp, u_long com } } #endif - break; + break; default: error = ether_ioctl(ifp, command, data); @@ -1710,7 +1710,6 @@ tsec_add_sysctls(struct tsec_softc *sc) * 100 Mbps, or 1Gbps, respectively. For detailed discussion consult the * TSEC reference manual. */ - static int tsec_sysctl_ic_time(SYSCTL_HANDLER_ARGS) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r188941 - in head: . gnu/usr.bin/gdb gnu/usr.bin/gdb/gdbserver
Author: raj Date: Mon Feb 23 18:22:49 2009 New Revision: 188941 URL: http://svn.freebsd.org/changeset/base/188941 Log: Initial gdbserver support for PowerPC. Obtained from:Juniper Networks, Semihalf Added: head/gnu/usr.bin/gdb/gdbserver/fbsd-ppc-low.c (contents, props changed) head/gnu/usr.bin/gdb/gdbserver/reg-ppc.c (contents, props changed) Modified: head/ObsoleteFiles.inc head/gnu/usr.bin/gdb/Makefile head/gnu/usr.bin/gdb/gdbserver/Makefile Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Mon Feb 23 18:22:06 2009(r188940) +++ head/ObsoleteFiles.inc Mon Feb 23 18:22:49 2009(r188941) @@ -1674,7 +1674,7 @@ OLD_FILES+=usr/lib/libpam_ssh.a OLD_FILES+=usr/lib/libpam_ssh_p.a OLD_FILES+=usr/bin/help OLD_FILES+=usr/bin/sccs -.if ${TARGET_ARCH} != "arm" && ${TARGET_ARCH} != "i386" +.if ${TARGET_ARCH} != "arm" && ${TARGET_ARCH} != "i386" && ${TARGET_ARCH} != "powerpc" OLD_FILES+=usr/bin/gdbserver .endif OLD_FILES+=usr/bin/ssh-keysign Modified: head/gnu/usr.bin/gdb/Makefile == --- head/gnu/usr.bin/gdb/Makefile Mon Feb 23 18:22:06 2009 (r188940) +++ head/gnu/usr.bin/gdb/Makefile Mon Feb 23 18:22:49 2009 (r188941) @@ -2,7 +2,7 @@ SUBDIR=doc libgdb gdb gdbtui kgdb -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "arm" +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "powerpc" SUBDIR+=gdbserver .endif Modified: head/gnu/usr.bin/gdb/gdbserver/Makefile == --- head/gnu/usr.bin/gdb/gdbserver/Makefile Mon Feb 23 18:22:06 2009 (r188940) +++ head/gnu/usr.bin/gdb/gdbserver/Makefile Mon Feb 23 18:22:49 2009 (r188941) @@ -22,6 +22,10 @@ SRCS+= fbsd-i386-low.c i387-fp.c reg-i38 SRCS+= fbsd-arm-low.c reg-arm.c .endif +.if ${MACHINE_ARCH} == "powerpc" +SRCS+= fbsd-ppc-low.c reg-ppc.c +.endif + #CFLAGS+= -I${.CURDIR}/../arch/${MACHINE_ARCH} CFLAGS+= -I${GDBDIR}/gdb/gdbserver CFLAGS+= -I${GDBDIR}/gdb/regformats Added: head/gnu/usr.bin/gdb/gdbserver/fbsd-ppc-low.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/gdb/gdbserver/fbsd-ppc-low.c Mon Feb 23 18:22:49 2009(r188941) @@ -0,0 +1,156 @@ +/* FreeBSD/PowerPC specific low level interface, for the remote server for + GDB. + Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002 + Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +__FBSDID("$FreeBSD$"); + +#include "server.h" +#include "fbsd-low.h" + +#include +#include + +#define ppc_num_regs 71 + +/* Currently, don't check/send MQ. */ +static int ppc_regmap[] = + { 0, 4, 8, 12, 16, 20, 24, 28, + 32, 36, 40, 44, 48, 52, 56, 60, + 64, 68, 72, 76, 80, 84, 88, 92, + 96, 100, 104, 108, 112, 116, 120, 124, +#if 0 + /* + * XXX on FreeBSD the gdbserver for PowerPC was only tested with FPU-less + * cores i.e. e500. Let's leave the original FPR references around in case + * someone picks up and brings support for AIM-like FPU machines. + */ + PT_FPR0*4, PT_FPR0*4 + 8, PT_FPR0*4+16, PT_FPR0*4+24, + PT_FPR0*4+32, PT_FPR0*4+40, PT_FPR0*4+48, PT_FPR0*4+56, + PT_FPR0*4+64, PT_FPR0*4+72, PT_FPR0*4+80, PT_FPR0*4+88, + PT_FPR0*4+96, PT_FPR0*4+104, PT_FPR0*4+112, PT_FPR0*4+120, + PT_FPR0*4+128, PT_FPR0*4+136, PT_FPR0*4+144, PT_FPR0*4+152, + PT_FPR0*4+160, PT_FPR0*4+168, PT_FPR0*4+176, PT_FPR0*4+184, + PT_FPR0*4+192, PT_FPR0*4+200, PT_FPR0*4+208, PT_FPR0*4+216, + PT_FPR0*4+224, PT_FPR0*4+232, PT_FPR0*4+240, PT_FPR0*4+248, +#endif + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + 144, -1, 132, 128, 140, 136, -1 + }; + +static int +ppc_cannot_store_register (int regno) +{ + /* Some kernels do not allow us to store fpscr. */ + if (regno == find_regno ("fpscr")) +return 2; + + return 0; +} +
svn commit: r189100 - in head/sys/powerpc: booke include powerpc
Author: raj Date: Fri Feb 27 12:08:24 2009 New Revision: 189100 URL: http://svn.freebsd.org/changeset/base/189100 Log: Make Book-E debug register state part of the PCB context. Previously, DBCR0 flags were set "globally", but this leads to problems because Book-E fine grained debug settings work only in conjuction with the debug master enable bit in MSR: in scenarios when the DBCR0 was set with intention to debug one process, but another one with MSR[DE] set got scheduled, the latter would immediately cause debug exceptions to occur upon execution of its own code instructions (and not the one intended for debugging). To avoid such problems and properly handle debugging context, DBCR0 state should be managed individually per process. Submitted by: Grzegorz Bernacki gjb ! semihalf dot com Reviewed by: marcel Modified: head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/swtch.S head/sys/powerpc/booke/trap.c head/sys/powerpc/booke/trap_subr.S head/sys/powerpc/include/frame.h head/sys/powerpc/include/pcb.h head/sys/powerpc/powerpc/genassym.c Modified: head/sys/powerpc/booke/machdep.c == --- head/sys/powerpc/booke/machdep.cFri Feb 27 06:01:42 2009 (r189099) +++ head/sys/powerpc/booke/machdep.cFri Feb 27 12:08:24 2009 (r189100) @@ -806,14 +806,10 @@ int ptrace_single_step(struct thread *td) { struct trapframe *tf; - u_int reg; - - reg = mfspr(SPR_DBCR0); - reg |= DBCR0_IC | DBCR0_IDM; - mtspr(SPR_DBCR0, reg); tf = td->td_frame; tf->srr1 |= PSL_DE; + tf->cpu.booke.dbcr0 |= (DBCR0_IDM | DBCR0_IC); return (0); } @@ -824,6 +820,7 @@ ptrace_clear_single_step(struct thread * tf = td->td_frame; tf->srr1 &= ~PSL_DE; + tf->cpu.booke.dbcr0 &= ~(DBCR0_IDM | DBCR0_IC); return (0); } Modified: head/sys/powerpc/booke/swtch.S == --- head/sys/powerpc/booke/swtch.S Fri Feb 27 06:01:42 2009 (r189099) +++ head/sys/powerpc/booke/swtch.S Fri Feb 27 12:08:24 2009 (r189100) @@ -66,6 +66,7 @@ #include #include #include +#include /* * void cpu_switch(struct thread *old, struct thread *new) @@ -87,6 +88,8 @@ ENTRY(cpu_switch) stw %r16, PCB_BOOKE_CTR(%r5) mfxer %r16 stw %r16, PCB_BOOKE_XER(%r5) + mfspr %r16, SPR_DBCR0 + stw %r16, PCB_BOOKE_DBCR0(%r5) stw %r1, PCB_SP(%r5)/* Save the stack pointer */ @@ -114,6 +117,8 @@ ENTRY(cpu_switch) mtctr %r5 lwz %r5, PCB_BOOKE_XER(%r3) mtxer %r5 + lwz %r5, PCB_BOOKE_DBCR0(%r3) + mtspr SPR_DBCR0, %r5 lwz %r1, PCB_SP(%r3)/* Load the stack pointer */ blr Modified: head/sys/powerpc/booke/trap.c == --- head/sys/powerpc/booke/trap.c Fri Feb 27 06:01:42 2009 (r189099) +++ head/sys/powerpc/booke/trap.c Fri Feb 27 12:08:24 2009 (r189100) @@ -187,6 +187,7 @@ trap(struct trapframe *frame) case EXC_DEBUG: /* Single stepping */ mtspr(SPR_DBSR, mfspr(SPR_DBSR)); frame->srr1 &= ~PSL_DE; + frame->cpu.booke.dbcr0 &= ~(DBCR0_IDM || DBCR0_IC); sig = SIGTRAP; break; Modified: head/sys/powerpc/booke/trap_subr.S == --- head/sys/powerpc/booke/trap_subr.S Fri Feb 27 06:01:42 2009 (r189099) +++ head/sys/powerpc/booke/trap_subr.S Fri Feb 27 12:08:24 2009 (r189100) @@ -207,6 +207,9 @@ stw %r4, FRAME_CTR+8(1);\ li %r5, exc; \ stw %r5, FRAME_EXC+8(1);\ + /* save DBCR0 */\ + mfspr %r3, SPR_DBCR0; \ + stw %r3, FRAME_BOOKE_DBCR0+8(1);\ /* save xSSR0-1 */ \ lwz %r30, (savearea+CPUSAVE_SRR0)(%r2); \ lwz %r31, (savearea+CPUSAVE_SRR1)(%r2); \ @@ -231,6 +234,9 @@ mtxer %r5;\ mtlr%r6;\ mtcr%r7;\ + /* restore DBCR0 */ \ + lwz %r4, FRAME_BOOKE_DBCR0+8(%r1); \ + mtspr SPR_DBCR0, %r4;
svn commit: r189101 - head/sys/powerpc/booke
Author: raj Date: Fri Feb 27 12:18:17 2009 New Revision: 189101 URL: http://svn.freebsd.org/changeset/base/189101 Log: Prefer register usage style to be more consistent with the rest of the trap_subr.S code. Modified: head/sys/powerpc/booke/trap_subr.S Modified: head/sys/powerpc/booke/trap_subr.S == --- head/sys/powerpc/booke/trap_subr.S Fri Feb 27 12:08:24 2009 (r189100) +++ head/sys/powerpc/booke/trap_subr.S Fri Feb 27 12:18:17 2009 (r189101) @@ -198,23 +198,23 @@ /* save DEAR, ESR */\ lwz %r28, (savearea+CPUSAVE_BOOKE_DEAR)(%r2); \ lwz %r29, (savearea+CPUSAVE_BOOKE_ESR)(%r2);\ - stw %r28, FRAME_BOOKE_DEAR+8(1);\ - stw %r29, FRAME_BOOKE_ESR+8(1); \ + stw %r28, FRAME_BOOKE_DEAR+8(%r1); \ + stw %r29, FRAME_BOOKE_ESR+8(%r1); \ /* save XER, CTR, exc number */ \ mfxer %r3;\ mfctr %r4;\ - stw %r3, FRAME_XER+8(1);\ - stw %r4, FRAME_CTR+8(1);\ + stw %r3, FRAME_XER+8(%r1); \ + stw %r4, FRAME_CTR+8(%r1); \ li %r5, exc; \ - stw %r5, FRAME_EXC+8(1);\ + stw %r5, FRAME_EXC+8(%r1); \ /* save DBCR0 */\ mfspr %r3, SPR_DBCR0; \ - stw %r3, FRAME_BOOKE_DBCR0+8(1);\ + stw %r3, FRAME_BOOKE_DBCR0+8(%r1); \ /* save xSSR0-1 */ \ lwz %r30, (savearea+CPUSAVE_SRR0)(%r2); \ lwz %r31, (savearea+CPUSAVE_SRR1)(%r2); \ - stw %r30, FRAME_SRR0+8(1); \ - stw %r31, FRAME_SRR1+8(1) + stw %r30, FRAME_SRR0+8(%r1);\ + stw %r31, FRAME_SRR1+8(%r1) /* * ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r189757 - in head/sys/powerpc: include mpc85xx
Author: raj Date: Fri Mar 13 06:28:20 2009 New Revision: 189757 URL: http://svn.freebsd.org/changeset/base/189757 Log: Make MPC85xx LAW handling and reset routines aware of the MPC8548 variant. Inspired by discussion with Alexey V Fedorov on freebsd-powe...@. Modified: head/sys/powerpc/include/spr.h head/sys/powerpc/mpc85xx/mpc85xx.c head/sys/powerpc/mpc85xx/mpc85xx.h head/sys/powerpc/mpc85xx/ocpbus.c Modified: head/sys/powerpc/include/spr.h == --- head/sys/powerpc/include/spr.h Fri Mar 13 06:06:20 2009 (r189756) +++ head/sys/powerpc/include/spr.h Fri Mar 13 06:28:20 2009 (r189757) @@ -564,6 +564,8 @@ #define SVR_MPC8533E0x8034 #define SVR_MPC8541 0x8072 #define SVR_MPC8541E0x807a +#define SVR_MPC8548 0x8031 +#define SVR_MPC8548E0x8039 #define SVR_MPC8555 0x8071 #define SVR_MPC8555E0x8079 #define SVR_MPC8572 0x80e0 Modified: head/sys/powerpc/mpc85xx/mpc85xx.c == --- head/sys/powerpc/mpc85xx/mpc85xx.c Fri Mar 13 06:06:20 2009 (r189756) +++ head/sys/powerpc/mpc85xx/mpc85xx.c Fri Mar 13 06:28:20 2009 (r189757) @@ -61,7 +61,7 @@ ccsr_write4(uintptr_t addr, uint32_t val __asm __volatile("eieio; sync"); } -static __inline int +int law_getmax(void) { uint32_t ver; @@ -69,6 +69,8 @@ law_getmax(void) ver = SVR_VER(mfspr(SPR_SVR)); if (ver == SVR_MPC8572E || ver == SVR_MPC8572) return (12); + else if (ver == SVR_MPC8548E || ver == SVR_MPC8548) + return (10); else return (8); } @@ -132,7 +134,8 @@ cpu_reset(void) { uint32_t ver = SVR_VER(mfspr(SPR_SVR)); - if (ver == SVR_MPC8572E || ver == SVR_MPC8572) + if (ver == SVR_MPC8572E || ver == SVR_MPC8572 || + ver == SVR_MPC8548E || ver == SVR_MPC8548) /* Systems with dedicated reset register */ ccsr_write4(OCP85XX_RSTCR, 2); else { Modified: head/sys/powerpc/mpc85xx/mpc85xx.h == --- head/sys/powerpc/mpc85xx/mpc85xx.h Fri Mar 13 06:06:20 2009 (r189756) +++ head/sys/powerpc/mpc85xx/mpc85xx.h Fri Mar 13 06:28:20 2009 (r189757) @@ -33,5 +33,6 @@ uint32_t ccsr_read4(uintptr_t addr); void ccsr_write4(uintptr_t addr, uint32_t val); int law_enable(int trgt, u_long addr, u_long size); int law_disable(int trgt, u_long addr, u_long size); +int law_getmax(void); #endif /* _MPC85XX_H_ */ Modified: head/sys/powerpc/mpc85xx/ocpbus.c == --- head/sys/powerpc/mpc85xx/ocpbus.c Fri Mar 13 06:06:20 2009 (r189756) +++ head/sys/powerpc/mpc85xx/ocpbus.c Fri Mar 13 06:28:20 2009 (r189757) @@ -114,8 +114,6 @@ devclass_t ocpbus_devclass; DRIVER_MODULE(ocpbus, nexus, ocpbus_driver, ocpbus_devclass, 0, 0); -static int law_max = 0; - static device_t ocpbus_mk_child(device_t dev, int type, int unit) { @@ -189,16 +187,6 @@ ocpbus_write_law(int trgt, int type, u_l static int ocpbus_probe(device_t dev) { - struct ocpbus_softc *sc; - uint32_t ver; - - sc = device_get_softc(dev); - - ver = SVR_VER(mfspr(SPR_SVR)); - if (ver == SVR_MPC8572E || ver == SVR_MPC8572) - law_max = 12; - else - law_max = 8; device_set_desc(dev, "On-Chip Peripherals bus"); return (BUS_PROBE_DEFAULT); @@ -208,7 +196,7 @@ static int ocpbus_attach(device_t dev) { struct ocpbus_softc *sc; - int error, i, tgt; + int error, i, tgt, law_max; uint32_t sr; u_long start, end; @@ -261,6 +249,7 @@ ocpbus_attach(device_t dev) * Clear local access windows. Skip DRAM entries, so we don't shoot * ourselves in the foot. */ + law_max = law_getmax(); for (i = 0; i < law_max; i++) { sr = ccsr_read4(OCP85XX_LAWSR(i)); if ((sr & 0x8000) == 0) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199533 - head/sys/powerpc/powerpc
Author: raj Date: Thu Nov 19 16:21:26 2009 New Revision: 199533 URL: http://svn.freebsd.org/changeset/base/199533 Log: Fix cpuid output on E500 core. Modified: head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/powerpc/cpu.c == --- head/sys/powerpc/powerpc/cpu.c Thu Nov 19 16:19:05 2009 (r199532) +++ head/sys/powerpc/powerpc/cpu.c Thu Nov 19 16:21:26 2009 (r199533) @@ -429,6 +429,8 @@ cpu_e500_setup(int cpuid, uint16_t vers) { register_t hid0; + printf("\n"); + hid0 = mfspr(SPR_HID0); printf("cpu%d: HID0 %b", cpuid, (int)hid0, HID0_E500_BITMASK); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199534 - head/sys/boot/uboot/common
Author: raj Date: Thu Nov 19 16:25:41 2009 New Revision: 199534 URL: http://svn.freebsd.org/changeset/base/199534 Log: Provide an effective (relocated) address when building modules metadata. This lets modules loaded dynamically in loader(8) work for U-Boot-based platforms. MFC after:1 week Modified: head/sys/boot/uboot/common/metadata.c Modified: head/sys/boot/uboot/common/metadata.c == --- head/sys/boot/uboot/common/metadata.c Thu Nov 19 16:21:26 2009 (r199533) +++ head/sys/boot/uboot/common/metadata.c Thu Nov 19 16:25:41 2009 (r199534) @@ -231,6 +231,7 @@ md_copymodules(vm_offset_t addr) struct preloaded_file *fp; struct file_metadata*md; int c; + vm_offset_t a; c = addr != 0; /* start with the first module on the list, should be the kernel */ @@ -240,7 +241,8 @@ md_copymodules(vm_offset_t addr) MOD_TYPE(addr, fp->f_type, c); if (fp->f_args) MOD_ARGS(addr, fp->f_args, c); - MOD_ADDR(addr, fp->f_addr, c); + a = fp->f_addr - __elfN(relocation_offset); + MOD_ADDR(addr, a, c); MOD_SIZE(addr, fp->f_size, c); for (md = fp->f_metadata; md != NULL; md = md->md_next) { if (!(md->md_type & MODINFOMD_NOCOPY)) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199580 - head/sys/dev/tsec
Author: raj Date: Fri Nov 20 13:28:06 2009 New Revision: 199580 URL: http://svn.freebsd.org/changeset/base/199580 Log: tsec: Use IFQ_DRV macros for managing interface packet queue. This lets tsec(4) work with ALTQ. Submitted by: Marcin Ligenza MFC after:1 week Modified: head/sys/dev/tsec/if_tsec.c Modified: head/sys/dev/tsec/if_tsec.c == --- head/sys/dev/tsec/if_tsec.c Fri Nov 20 12:48:35 2009(r199579) +++ head/sys/dev/tsec/if_tsec.c Fri Nov 20 13:28:06 2009(r199580) @@ -716,9 +716,9 @@ tsec_start_locked(struct ifnet *ifp) bus_dmamap_sync(sc->tsec_tx_dtag, sc->tsec_tx_dmap, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - for (;;) { + while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { /* Get packet from the queue */ - IF_DEQUEUE(&ifp->if_snd, m0); + IFQ_DRV_DEQUEUE(&ifp->if_snd, m0); if (m0 == NULL) break; @@ -755,7 +755,7 @@ tsec_start_locked(struct ifnet *ifp) m0 = mtmp; if (tsec_encap(sc, m0, fcb_inserted)) { - IF_PREPEND(&ifp->if_snd, m0); + IFQ_DRV_PREPEND(&ifp->if_snd, m0); ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199850 - stable/8/sys/boot/uboot/common
Author: raj Date: Thu Nov 26 22:35:26 2009 New Revision: 199850 URL: http://svn.freebsd.org/changeset/base/199850 Log: MFC r199534: Provide an effective (relocated) address when building modules metadata. This lets modules loaded dynamically in loader(8) work for U-Boot-based platforms. Modified: stable/8/sys/boot/uboot/common/metadata.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/uboot/common/metadata.c == --- stable/8/sys/boot/uboot/common/metadata.c Thu Nov 26 22:09:37 2009 (r199849) +++ stable/8/sys/boot/uboot/common/metadata.c Thu Nov 26 22:35:26 2009 (r199850) @@ -231,6 +231,7 @@ md_copymodules(vm_offset_t addr) struct preloaded_file *fp; struct file_metadata*md; int c; + vm_offset_t a; c = addr != 0; /* start with the first module on the list, should be the kernel */ @@ -240,7 +241,8 @@ md_copymodules(vm_offset_t addr) MOD_TYPE(addr, fp->f_type, c); if (fp->f_args) MOD_ARGS(addr, fp->f_args, c); - MOD_ADDR(addr, fp->f_addr, c); + a = fp->f_addr - __elfN(relocation_offset); + MOD_ADDR(addr, a, c); MOD_SIZE(addr, fp->f_size, c); for (md = fp->f_metadata; md != NULL; md = md->md_next) { if (!(md->md_type & MODINFOMD_NOCOPY)) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199865 - stable/8/sys/dev/tsec
Author: raj Date: Fri Nov 27 13:38:59 2009 New Revision: 199865 URL: http://svn.freebsd.org/changeset/base/199865 Log: MFC r199580: tsec: Use IFQ_DRV macros for managing interface packet queue. This lets tsec(4) work with ALTQ. Submitted by: Marcin Ligenza Modified: stable/8/sys/dev/tsec/if_tsec.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/tsec/if_tsec.c == --- stable/8/sys/dev/tsec/if_tsec.c Fri Nov 27 13:19:06 2009 (r199864) +++ stable/8/sys/dev/tsec/if_tsec.c Fri Nov 27 13:38:59 2009 (r199865) @@ -716,9 +716,9 @@ tsec_start_locked(struct ifnet *ifp) bus_dmamap_sync(sc->tsec_tx_dtag, sc->tsec_tx_dmap, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - for (;;) { + while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { /* Get packet from the queue */ - IF_DEQUEUE(&ifp->if_snd, m0); + IFQ_DRV_DEQUEUE(&ifp->if_snd, m0); if (m0 == NULL) break; @@ -755,7 +755,7 @@ tsec_start_locked(struct ifnet *ifp) m0 = mtmp; if (tsec_encap(sc, m0, fcb_inserted)) { - IF_PREPEND(&ifp->if_snd, m0); + IFQ_DRV_PREPEND(&ifp->if_snd, m0); ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r210246 - in head/sys: arm/mv conf dev/fdt
Author: raj Date: Mon Jul 19 18:41:50 2010 New Revision: 210246 URL: http://svn.freebsd.org/changeset/base/210246 Log: Move MRVL FDT fixups and PIC decode routine to a platform specific area. This allows for better encapsulation (and eliminates generic fdt_arm.c, at least for now). Deleted: head/sys/dev/fdt/fdt_arm.c Modified: head/sys/arm/mv/common.c head/sys/conf/files.arm Modified: head/sys/arm/mv/common.c == --- head/sys/arm/mv/common.cMon Jul 19 18:20:44 2010(r210245) +++ head/sys/arm/mv/common.cMon Jul 19 18:41:50 2010(r210246) @@ -1834,3 +1834,45 @@ fdt_win_setup(void) return (0); } + +static void +fdt_fixup_busfreq(phandle_t root) +{ + phandle_t sb; + pcell_t freq; + + /* +* This fixup sets the simple-bus bus-frequency property. +*/ + + if ((sb = fdt_find_compatible(root, "simple-bus", 1)) == 0) + return; + + freq = cpu_to_fdt32(get_tclk()); + OF_setprop(sb, "bus-frequency", (void *)&freq, sizeof(freq)); +} + +struct fdt_fixup_entry fdt_fixup_table[] = { + { "mrvl,DB-88F6281", &fdt_fixup_busfreq }, + { NULL, NULL } +}; + +static int +fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, +int *pol) +{ + + if (!fdt_is_compatible(node, "mrvl,pic")) + return (ENXIO); + + *interrupt = fdt32_to_cpu(intr[0]); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + + return (0); +} + +fdt_pic_decode_t fdt_pic_table[] = { + &fdt_pic_decode_ic, + NULL +}; Modified: head/sys/conf/files.arm == --- head/sys/conf/files.arm Mon Jul 19 18:20:44 2010(r210245) +++ head/sys/conf/files.arm Mon Jul 19 18:41:50 2010(r210246) @@ -47,7 +47,6 @@ arm/arm/vm_machdep.c standard arm/fpe-arm/armfpe_glue.S optionalarmfpe arm/fpe-arm/armfpe_init.c optionalarmfpe arm/fpe-arm/armfpe.S optionalarmfpe -dev/fdt/fdt_arm.c optionalfdt dev/hwpmc/hwpmc_arm.c optionalhwpmc dev/ofw/openfirm.c optionalfdt dev/ofw/openfirmio.c optionalfdt ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r210247 - in head/sys: arm/include arm/mv dev/fdt dev/uart powerpc/booke powerpc/include
Author: raj Date: Mon Jul 19 18:47:18 2010 New Revision: 210247 URL: http://svn.freebsd.org/changeset/base/210247 Log: Eliminate FDT_IMMR_VA define. This removes platform dependencies from /fdt.h for the benfit of portability. Modified: head/sys/arm/include/fdt.h head/sys/arm/mv/mv_machdep.c head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/fdt_common.h head/sys/dev/uart/uart_bus_fdt.c head/sys/powerpc/booke/machdep.c head/sys/powerpc/include/fdt.h Modified: head/sys/arm/include/fdt.h == --- head/sys/arm/include/fdt.h Mon Jul 19 18:41:50 2010(r210246) +++ head/sys/arm/include/fdt.h Mon Jul 19 18:47:18 2010(r210247) @@ -37,18 +37,10 @@ #include #include +#include #include #include -#include -#include - -/* - * This is the base virtual address the internal mem-mapped registers (IMMR) - * range is available at. - */ -#define FDT_IMMR_VAMV_BASE - /* Max interrupt number */ #define FDT_INTR_MAX NIRQ Modified: head/sys/arm/mv/mv_machdep.c == --- head/sys/arm/mv/mv_machdep.cMon Jul 19 18:41:50 2010 (r210246) +++ head/sys/arm/mv/mv_machdep.cMon Jul 19 18:47:18 2010 (r210247) @@ -380,7 +380,7 @@ initarm(void *mdp, void *unused __unused &memsize) != 0) while(1); - if (fdt_immr_addr() != 0) + if (fdt_immr_addr(MV_BASE) != 0) while (1); /* Platform-specific initialisation */ Modified: head/sys/dev/fdt/fdt_common.c == --- head/sys/dev/fdt/fdt_common.c Mon Jul 19 18:41:50 2010 (r210246) +++ head/sys/dev/fdt/fdt_common.c Mon Jul 19 18:47:18 2010 (r210247) @@ -63,7 +63,7 @@ vm_offset_t fdt_immr_va; vm_offset_t fdt_immr_size; int -fdt_immr_addr(void) +fdt_immr_addr(vm_offset_t immr_va) { pcell_t ranges[6], *rangesptr; phandle_t node; @@ -122,7 +122,7 @@ moveon: size = fdt_data_get((void *)rangesptr, size_cells); fdt_immr_pa = base; - fdt_immr_va = FDT_IMMR_VA; + fdt_immr_va = immr_va; fdt_immr_size = size; return (0); Modified: head/sys/dev/fdt/fdt_common.h == --- head/sys/dev/fdt/fdt_common.h Mon Jul 19 18:41:50 2010 (r210246) +++ head/sys/dev/fdt/fdt_common.h Mon Jul 19 18:47:18 2010 (r210247) @@ -90,7 +90,7 @@ int fdt_data_verify(void *, int); phandle_t fdt_find_compatible(phandle_t, const char *, int); int fdt_get_mem_regions(struct mem_region *, int *, uint32_t *); int fdt_get_phyaddr(phandle_t node, int *); -int fdt_immr_addr(void); +int fdt_immr_addr(vm_offset_t); int fdt_regsize(phandle_t, u_long *, u_long *); int fdt_intr_decode(phandle_t, pcell_t *, int *, int *, int *); int fdt_intr_to_rl(phandle_t, struct resource_list *, struct fdt_sense_level *); Modified: head/sys/dev/uart/uart_bus_fdt.c == --- head/sys/dev/uart/uart_bus_fdt.cMon Jul 19 18:41:50 2010 (r210246) +++ head/sys/dev/uart/uart_bus_fdt.cMon Jul 19 18:47:18 2010 (r210247) @@ -188,7 +188,7 @@ uart_cpu_getdev(int devtype, struct uart err = fdt_regsize(node, &start, &size); if (err) return (ENXIO); - start += FDT_IMMR_VA; + start += fdt_immr_va; uart_bus_space_mem = fdtbus_bs_tag; uart_bus_space_io = NULL; Modified: head/sys/powerpc/booke/machdep.c == --- head/sys/powerpc/booke/machdep.cMon Jul 19 18:41:50 2010 (r210246) +++ head/sys/powerpc/booke/machdep.cMon Jul 19 18:47:18 2010 (r210247) @@ -319,7 +319,7 @@ e500_init(u_int32_t startkernel, u_int32 if (OF_init((void *)dtbp) != 0) while (1); - if (fdt_immr_addr() != 0) + if (fdt_immr_addr(CCSRBAR_VA) != 0) while (1); OF_interpret("perform-fixup", 0); Modified: head/sys/powerpc/include/fdt.h == --- head/sys/powerpc/include/fdt.h Mon Jul 19 18:41:50 2010 (r210246) +++ head/sys/powerpc/include/fdt.h Mon Jul 19 18:47:18 2010 (r210247) @@ -34,14 +34,6 @@ #include #include -#include -#include - -/* - * This is the base virtual address the internal mem-mapped registers (IMMR) - * range is available at. - */ -#define FDT_IMMR_VACCSRBAR_VA /* Max interrupt number */ #define FDT_INTR_MAX INTR_VECTORS ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-
svn commit: r210249 - in head/sys: arm/mv arm/mv/discovery arm/mv/kirkwood arm/mv/orion conf
Author: raj Date: Mon Jul 19 19:19:33 2010 New Revision: 210249 URL: http://svn.freebsd.org/changeset/base/210249 Log: Now that we are fully FDT-driven on MRVL platforms, remove PHYSMEM_SIZE option. Modified: head/sys/arm/mv/discovery/std.db78xxx head/sys/arm/mv/kirkwood/std.db88f6xxx head/sys/arm/mv/kirkwood/std.sheevaplug head/sys/arm/mv/mv_machdep.c head/sys/arm/mv/orion/std.db88f5xxx head/sys/conf/options.arm Modified: head/sys/arm/mv/discovery/std.db78xxx == --- head/sys/arm/mv/discovery/std.db78xxx Mon Jul 19 18:56:18 2010 (r210248) +++ head/sys/arm/mv/discovery/std.db78xxx Mon Jul 19 19:19:33 2010 (r210249) @@ -9,5 +9,4 @@ makeoptions KERNVIRTADDR=0xc090 optionsKERNPHYSADDR=0x0090 optionsKERNVIRTADDR=0xc090 optionsPHYSADDR=0x -optionsPHYSMEM_SIZE=0x2000 optionsSTARTUP_PAGETABLE_ADDR=0x0010 Modified: head/sys/arm/mv/kirkwood/std.db88f6xxx == --- head/sys/arm/mv/kirkwood/std.db88f6xxx Mon Jul 19 18:56:18 2010 (r210248) +++ head/sys/arm/mv/kirkwood/std.db88f6xxx Mon Jul 19 19:19:33 2010 (r210249) @@ -3,5 +3,3 @@ include"../mv/std.mv" include "../mv/kirkwood/std.kirkwood" files "../mv/kirkwood/files.kirkwood" - -optionsPHYSMEM_SIZE=0x2000 Modified: head/sys/arm/mv/kirkwood/std.sheevaplug == --- head/sys/arm/mv/kirkwood/std.sheevaplug Mon Jul 19 18:56:18 2010 (r210248) +++ head/sys/arm/mv/kirkwood/std.sheevaplug Mon Jul 19 19:19:33 2010 (r210249) @@ -3,5 +3,3 @@ include"../mv/std.mv" include "../mv/kirkwood/std.kirkwood" files "../mv/kirkwood/files.sheevaplug" - -optionsPHYSMEM_SIZE=0x2000 Modified: head/sys/arm/mv/mv_machdep.c == --- head/sys/arm/mv/mv_machdep.cMon Jul 19 18:56:18 2010 (r210248) +++ head/sys/arm/mv/mv_machdep.cMon Jul 19 19:19:33 2010 (r210249) @@ -153,7 +153,7 @@ static int availmem_regions_sz; static void print_kenv(void); static void print_kernel_section_addr(void); -static void physmap_init(int); +static void physmap_init(void); static int platform_devmap_init(void); static int platform_mpp_init(void); @@ -202,7 +202,7 @@ print_kernel_section_addr(void) } static void -physmap_init(int hardcoded) +physmap_init(void) { int i, j, cnt; vm_offset_t phys_kernelend, kernload; @@ -213,22 +213,6 @@ physmap_init(int hardcoded) kernload = KERNPHYSADDR; /* -* Use hardcoded physical addresses if we don't use memory regions -* from metadata. -*/ - if (hardcoded) { - phys_avail[0] = 0; - phys_avail[1] = kernload; - - phys_avail[2] = phys_kernelend; - phys_avail[3] = PHYSMEM_SIZE; - - phys_avail[4] = 0; - phys_avail[5] = 0; - return; - } - - /* * Remove kernel physical address range from avail * regions list. Page align all regions. * Non-page aligned memory isn't very interesting to us. @@ -352,12 +336,6 @@ initarm(void *mdp, void *unused __unused } else { /* Fall back to hardcoded metadata. */ lastaddr = fake_preload_metadata(); - - /* -* Assume a single memory region of size specified in board -* configuration file. -*/ - memsize = PHYSMEM_SIZE; } #if defined(FDT_DTB_STATIC) @@ -602,10 +580,8 @@ initarm(void *mdp, void *unused __unused /* * Prepare map of physical memory regions available to vm subsystem. -* If metadata pointer doesn't point to a valid address, use hardcoded -* values. */ - physmap_init((mdp != NULL) ? 0 : 1); + physmap_init(); /* Do basic tuning, hz etc */ init_param1(); Modified: head/sys/arm/mv/orion/std.db88f5xxx == --- head/sys/arm/mv/orion/std.db88f5xxx Mon Jul 19 18:56:18 2010 (r210248) +++ head/sys/arm/mv/orion/std.db88f5xxx Mon Jul 19 19:19:33 2010 (r210249) @@ -9,5 +9,4 @@ makeoptions KERNVIRTADDR=0xc090 optionsKERNPHYSADDR=0x0090 optionsKERNVIRTADDR=0xc090 optionsPHYSADDR=0x -optionsPHYSMEM_SIZE=0x0800 optionsSTARTUP_PAGETABLE_ADDR=0x0010 Modified: head/sys/conf/options.arm ==