Date: Wed, 26 Jul 2006 17:39:02 GMT From: Paolo Pisati <piso@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 102475 for review Message-ID: <200607261739.k6QHd2Ac047519@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=102475 Change 102475 by piso@piso_newluxor on 2006/07/26 17:39:01 IFC (again) Affected files ... .. //depot/projects/soc2005/libalias/UPDATING#3 integrate .. //depot/projects/soc2005/libalias/sys/dev/uart/uart_cpu_powerpc.c#2 integrate .. //depot/projects/soc2005/libalias/sys/dev/uart/uart_dev_z8530.c#2 integrate .. //depot/projects/soc2005/libalias/sys/powerpc/conf/GENERIC#3 integrate .. //depot/projects/soc2005/libalias/sys/powerpc/conf/NOTES#2 integrate .. //depot/projects/soc2005/libalias/sys/powerpc/include/md_var.h#2 integrate .. //depot/projects/soc2005/libalias/sys/powerpc/include/ofw_machdep.h#2 integrate .. //depot/projects/soc2005/libalias/sys/powerpc/include/pcb.h#2 integrate .. //depot/projects/soc2005/libalias/sys/powerpc/powerpc/clock.c#2 integrate .. //depot/projects/soc2005/libalias/sys/powerpc/powerpc/mem.c#2 integrate .. //depot/projects/soc2005/libalias/sys/powerpc/powerpc/ofw_machdep.c#2 integrate Differences ... ==== //depot/projects/soc2005/libalias/UPDATING#3 (text+ko) ==== @@ -21,6 +21,13 @@ developers choose to disable these features on build machines to maximize performance. +20060725: + enigma(1)/crypt(1) utility has been changed on 64 bit architectures. + Now it can decrypt files created from different architectures. + Unfortunately, it is no longer able to decrypt a cipher text + generated with an older version on 64 bit architectures. + If you have such a file, you need old utility to decrypt it. + 20060709: The interface version of the i4b kernel part has changed. So after updating the kernel sources and compiling a new kernel, @@ -591,4 +598,4 @@ Contact Warner Losh if you have any questions about your use of this document. -$FreeBSD: src/UPDATING,v 1.451 2006/07/09 21:16:06 twinterg Exp $ +$FreeBSD: src/UPDATING,v 1.452 2006/07/26 16:31:10 jkim Exp $ ==== //depot/projects/soc2005/libalias/sys/dev/uart/uart_cpu_powerpc.c#2 (text) ==== @@ -25,14 +25,16 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/uart/uart_cpu_powerpc.c,v 1.1 2006/03/31 01:42:55 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/uart/uart_cpu_powerpc.c,v 1.2 2006/07/26 17:17:23 marcel Exp $"); #include <sys/param.h> #include <sys/systm.h> -#include <sys/bus.h> #include <machine/bus.h> +#include <dev/ofw/openfirm.h> +#include <machine/ofw_machdep.h> + #include <dev/uart/uart.h> #include <dev/uart/uart_cpu.h> @@ -43,12 +45,63 @@ uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) { - return (0); + return ((b1->bsh == b2->bsh) ? 1 : 0); } int uart_cpu_getdev(int devtype, struct uart_devinfo *di) { + char buf[64]; + phandle_t input, opts; + int error; - return (ENXIO); + if ((opts = OF_finddevice("/options")) == -1) + return (ENXIO); + switch (devtype) { + case UART_DEV_CONSOLE: + if (OF_getprop(opts, "input-device", buf, sizeof(buf)) == -1) + return (ENXIO); + input = OF_finddevice(buf); + if (input == -1) + return (ENXIO); + if (OF_getprop(opts, "output-device", buf, sizeof(buf)) == -1) + return (ENXIO); + if (OF_finddevice(buf) != input) + return (ENXIO); + break; + case UART_DEV_DBGPORT: + if (!getenv_string("hw.uart.dbgport", buf, sizeof(buf))) + return (ENXIO); + input = OF_finddevice(buf); + if (input == -1) + return (ENXIO); + break; + default: + return (EINVAL); + } + + if (OF_getprop(input, "device_type", buf, sizeof(buf)) == -1) + return (ENXIO); + if (strcmp(buf, "serial") != 0) + return (ENXIO); + if (OF_getprop(input, "name", buf, sizeof(buf)) == -1) + return (ENXIO); + if (strcmp(buf, "ch-a")) + return (ENXIO); + + error = OF_decode_addr(input, 0, &di->bas.bst, &di->bas.bsh); + if (error) + return (error); + + di->ops = uart_z8530_ops; + + di->bas.rclk = 230400; + di->bas.chan = 1; + di->bas.regshft = 4; + + di->baudrate = 0; + di->databits = 8; + di->stopbits = 1; + di->parity = UART_PARITY_NONE; + return (0); } ==== //depot/projects/soc2005/libalias/sys/dev/uart/uart_dev_z8530.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_z8530.c,v 1.18 2006/05/12 23:24:45 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_z8530.c,v 1.20 2006/07/26 17:29:37 marcel Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -43,6 +43,13 @@ #define DEFAULT_RCLK 307200 +/* Hack! */ +#ifdef __powerpc__ +#define UART_PCLK 0 +#else +#define UART_PCLK MCB2_PCLK +#endif + /* Multiplexed I/O. */ static __inline void uart_setmreg(struct uart_bas *bas, int reg, int val) @@ -124,7 +131,7 @@ } else divisor = -1; - uart_setmreg(bas, WR_MCB2, MCB2_PCLK); + uart_setmreg(bas, WR_MCB2, UART_PCLK); uart_barrier(bas); if (divisor >= 0) { @@ -140,7 +147,7 @@ uart_barrier(bas); uart_setmreg(bas, WR_TPC, tpc); uart_barrier(bas); - uart_setmreg(bas, WR_MCB2, MCB2_PCLK | MCB2_BRGE); + uart_setmreg(bas, WR_MCB2, UART_PCLK | MCB2_BRGE); uart_barrier(bas); *tpcp = tpc; return (0); @@ -167,7 +174,7 @@ uart_barrier(bas); /* Set clock sources. */ uart_setmreg(bas, WR_CMC, CMC_RC_BRG | CMC_TC_BRG); - uart_setmreg(bas, WR_MCB2, MCB2_PCLK); + uart_setmreg(bas, WR_MCB2, UART_PCLK); uart_barrier(bas); /* Set data encoding. */ uart_setmreg(bas, WR_MCB1, MCB1_NRZ); @@ -383,7 +390,7 @@ { struct z8530_softc *z8530 = (struct z8530_softc*)sc; struct uart_bas *bas; - int error; + int baudrate, divisor, error; bas = &sc->sc_bas; error = 0; @@ -397,6 +404,12 @@ uart_setmreg(bas, WR_TPC, z8530->tpc); uart_barrier(bas); break; + case UART_IOCTL_BAUD: + divisor = uart_getmreg(bas, RR_TCH); + divisor = (divisor << 8) | uart_getmreg(bas, RR_TCL); + baudrate = bas->rclk / 2 / (divisor + 2); + *(int*)data = baudrate; + break; default: error = EINVAL; break; ==== //depot/projects/soc2005/libalias/sys/powerpc/conf/GENERIC#3 (text+ko) ==== @@ -16,7 +16,7 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/powerpc/conf/GENERIC,v 1.57 2006/06/26 22:03:22 babkin Exp $ +# $FreeBSD: src/sys/powerpc/conf/GENERIC,v 1.58 2006/07/26 17:34:05 marcel Exp $ cpu OEA ident GENERIC @@ -25,7 +25,6 @@ #hints "GENERIC.hints" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -makeoptions WERROR=-Wno-error #XXX: We don't want -Werror just now # Platform support options POWERMAC #NewWorld Apple PowerMacs @@ -93,8 +92,8 @@ makeoptions SC_DFLT_FONT=cp437 # Serial (COM) ports -#device sio # 8250, 16[45]50 based serial ports -device zs # Zilog 8350 based serial ports +device scc +device uart # PCI Ethernet NICs that use the common MII bus controller code. device miibus # MII bus support ==== //depot/projects/soc2005/libalias/sys/powerpc/conf/NOTES#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/powerpc/conf/NOTES,v 1.2 2005/12/30 16:45:31 ru Exp $ +# $FreeBSD: src/sys/powerpc/conf/NOTES,v 1.3 2006/07/26 17:35:40 marcel Exp $ # # This file contains machine dependent kernel configuration notes. For # machine independent notes, look in /sys/conf/NOTES. @@ -20,7 +20,6 @@ # Standard busses device pci -device zs # Zilog 8350 based serial ports device gem # Sun GEM/Sun ERI/Apple GMAC device ofwd # Open Firmware disks @@ -31,6 +30,7 @@ nodevice atkbdc nodevice atkbd nodevice psm +nodevice sio nodevice vga nodevice fdc nodevice ppc @@ -52,16 +52,12 @@ nodevice snake_saver # needs outsw use fixed nodevice cs -# XXX can't remember why -nodevice uart # isa nodevice pcii nodevice tnt4882 # wants gdb_cur nodevice dcons nodevice dcons_crom -# not yet -nodevice sio ##################################################################### ==== //depot/projects/soc2005/libalias/sys/powerpc/include/md_var.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/powerpc/include/md_var.h,v 1.26 2003/08/16 16:57:57 marcel Exp $ + * $FreeBSD: src/sys/powerpc/include/md_var.h,v 1.27 2006/07/26 17:12:54 marcel Exp $ */ #ifndef _MACHINE_MD_VAR_H_ @@ -52,6 +52,7 @@ void busdma_swi(void); int is_physical_memory(vm_offset_t addr); +int mem_valid(vm_offset_t addr, int len); void decr_init(void); ==== //depot/projects/soc2005/libalias/sys/powerpc/include/ofw_machdep.h#2 (text+ko) ==== @@ -22,7 +22,7 @@ * 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: src/sys/powerpc/include/ofw_machdep.h,v 1.2 2004/08/16 13:07:40 ssouhlal Exp $ + * $FreeBSD: src/sys/powerpc/include/ofw_machdep.h,v 1.3 2006/07/26 17:12:54 marcel Exp $ */ #ifndef _MACHINE_OFW_MACHDEP_H_ @@ -30,7 +30,7 @@ #include <sys/bus.h> +int OF_decode_addr(phandle_t, int, bus_space_tag_t *, bus_space_handle_t *); void OF_getetheraddr(device_t dev, u_char *addr); -int mem_valid(vm_offset_t addr, int len); #endif /* _MACHINE_OFW_MACHDEP_H_ */ ==== //depot/projects/soc2005/libalias/sys/powerpc/include/pcb.h#2 (text+ko) ==== @@ -29,7 +29,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $NetBSD: pcb.h,v 1.4 2000/06/04 11:57:17 tsubai Exp $ - * $FreeBSD: src/sys/powerpc/include/pcb.h,v 1.8 2004/07/12 22:17:20 grehan Exp $ + * $FreeBSD: src/sys/powerpc/include/pcb.h,v 1.9 2006/07/26 17:05:11 marcel Exp $ */ #ifndef _MACHINE_PCB_H_ @@ -59,6 +59,8 @@ #ifdef _KERNEL +struct trapframe; + #ifndef curpcb extern struct pcb *curpcb; #endif ==== //depot/projects/soc2005/libalias/sys/powerpc/powerpc/clock.c#2 (text+ko) ==== @@ -56,7 +56,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/powerpc/powerpc/clock.c,v 1.23 2006/05/16 14:32:17 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/powerpc/powerpc/clock.c,v 1.24 2006/07/26 17:06:39 marcel Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -68,6 +68,7 @@ #include <dev/ofw/openfirm.h> +#include <machine/clock.h> #include <machine/cpu.h> #include <machine/intr.h> #include <machine/md_var.h> ==== //depot/projects/soc2005/libalias/sys/powerpc/powerpc/mem.c#2 (text+ko) ==== @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/powerpc/powerpc/mem.c,v 1.1 2004/08/16 13:07:40 ssouhlal Exp $"); +__FBSDID("$FreeBSD: src/sys/powerpc/powerpc/mem.c,v 1.2 2006/07/26 17:12:54 marcel Exp $"); /* * Memory special file @@ -59,7 +59,6 @@ #include <sys/uio.h> #include <machine/md_var.h> -#include <machine/ofw_machdep.h> #include <machine/vmparam.h> #include <vm/vm.h> ==== //depot/projects/soc2005/libalias/sys/powerpc/powerpc/ofw_machdep.c#2 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/powerpc/powerpc/ofw_machdep.c,v 1.15 2005/11/11 09:32:27 grehan Exp $"); +__FBSDID("$FreeBSD: src/sys/powerpc/powerpc/ofw_machdep.c,v 1.16 2006/07/26 17:12:54 marcel Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -51,6 +51,8 @@ #include <vm/vm_param.h> #include <vm/vm_page.h> +#include <machine/bus.h> +#include <machine/md_var.h> #include <machine/powerpc.h> #include <machine/ofw_machdep.h> #include <powerpc/ofw/ofw_pci.h> @@ -284,6 +286,22 @@ OF_getprop(node, "local-mac-address", addr, ETHER_ADDR_LEN); } +/* + * Return the physical address and the bus space to use for a node + * referenced by its package handle and the index of the register bank + * to decode. Intended to be used by console drivers in early boot only. + * Works by mapping the address of the node's bank given in the address + * space of its parent upward in the device tree at each bridge along the + * path. + */ +int +OF_decode_addr(phandle_t node, int bank, bus_space_tag_t *tag, + bus_space_handle_t *handle) +{ + + return (ENXIO); +} + int mem_valid(vm_offset_t addr, int len) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607261739.k6QHd2Ac047519>