From owner-p4-projects@FreeBSD.ORG Tue Jan 1 10:55:53 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A2329530; Tue, 1 Jan 2013 10:55:53 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6017752E for ; Tue, 1 Jan 2013 10:55:53 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 4213E8FC08 for ; Tue, 1 Jan 2013 10:55:53 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r01AtrHk011800 for ; Tue, 1 Jan 2013 10:55:53 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r01Atq8s011797 for perforce@freebsd.org; Tue, 1 Jan 2013 10:55:52 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Tue, 1 Jan 2013 10:55:52 GMT Message-Id: <201301011055.r01Atq8s011797@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219932 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2013 10:55:53 -0000 http://p4web.freebsd.org/@@219932?ac=10 Change 219932 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/01 10:55:08 FDT headers can't be included if the kernel is compiled without FDT support, due to dependence on generated kobj headers. Spotted by: bz Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/mips/beri/beri_machdep.c#6 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/mips/beri/beri_machdep.c#6 (text+ko) ==== @@ -55,8 +55,10 @@ #include #include +#ifdef FDT #include #include +#endif #include #include From owner-p4-projects@FreeBSD.ORG Wed Jan 2 09:32:27 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A3150FFD; Wed, 2 Jan 2013 09:32:27 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4ED19FFB for ; Wed, 2 Jan 2013 09:32:27 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 326B98FC0A for ; Wed, 2 Jan 2013 09:32:27 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r029WRKi074134 for ; Wed, 2 Jan 2013 09:32:27 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r029WQEm074131 for perforce@freebsd.org; Wed, 2 Jan 2013 09:32:26 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Wed, 2 Jan 2013 09:32:26 GMT Message-Id: <201301020932.r029WQEm074131@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219933 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2013 09:32:27 -0000 http://p4web.freebsd.org/@@219933?ac=10 Change 219933 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/02 09:32:16 Implement an FDT PIC decode routine to use when no PIC has been configured, which assumes a cascade back to the nexus bus (e.g., the on-board CP0 interrupt management parts on the MIPS). If the soc bus in a MIPS DTS file is declared as "mips4k,cp0"-compatible, then this will be enabled. This is sufficient to allow IRQs to be configured on BERI. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/dev/fdt/fdt_mips.c#2 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/dev/fdt/fdt_mips.c#2 (text+ko) ==== @@ -49,8 +49,26 @@ { NULL, NULL } }; +/* + * For PIC-free boards, provide a PIC decoder to be used with mips4k CP0 + * interrupt control directly. + */ +static int +fdt_pic_decode_mips4k_cp0(phandle_t node, pcell_t *intr, int *interrupt, + int *trig, int *pol) +{ + + if (!fdt_is_compatible(node, "mips4k,cp0")) + 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[] = { - NULL, - NULL, + &fdt_pic_decode_mips4k_cp0, NULL }; From owner-p4-projects@FreeBSD.ORG Wed Jan 2 09:34:30 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1A0D718F; Wed, 2 Jan 2013 09:34:30 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEA3718D for ; Wed, 2 Jan 2013 09:34:29 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id B00A18FC08 for ; Wed, 2 Jan 2013 09:34:29 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r029YTen074348 for ; Wed, 2 Jan 2013 09:34:29 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r029YTfM074345 for perforce@freebsd.org; Wed, 2 Jan 2013 09:34:29 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Wed, 2 Jan 2013 09:34:29 GMT Message-Id: <201301020934.r029YTfM074345@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219934 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2013 09:34:30 -0000 http://p4web.freebsd.org/@@219934?ac=10 Change 219934 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/02 09:33:48 Enable mips4k,cp0 interrupt configuration for the BERI FDT DTS file, as well as interrupts on the first JTAG UART. Move atse configuration from device.hints to FDT. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-de4.dts#8 edit .. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_FDT_DE4.hints#6 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-de4.dts#8 (text+ko) ==== @@ -55,7 +55,13 @@ soc { #address-cells = <1>; #size-cells = <1>; - compatible = "simple-bus"; + #interrupt-cells = <1>; + + /* + * Declare mips4k,cp0 since BERI doesn't (yet) have a PIC, so + * we use mips4k coprocessor 0 interrupt management directly. + */ + compatible = "simple-bus", "mips4k,cp0"; ranges = <>; memory { @@ -66,7 +72,7 @@ serial@7f000000 { compatible = "altera,jtag_uart-11_0"; reg = <0x7f000000 0x40>; - // interrupts = <0>; + interrupts = <0>; }; serial@7f001000 { @@ -89,12 +95,12 @@ reg = <0x7f006000 0x1>; }; -/* ethernet@7f007000 { compatible = "altera,atse"; reg = <0x7f007000 0x540>; }; +/* touchscreen@70400000 { compatible = "cambridge,mtl"; reg = <0x70400000 0x1000 ==== //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_FDT_DE4.hints#6 (text+ko) ==== @@ -35,9 +35,9 @@ # # Altera Triple-Speed Ethernet Mac, present in tPad and DE-4 configurations # -hint.atse.0.at="nexus0" -hint.atse.0.maddr=0x7f007000 -hint.atse.0.msize=0x540 +#hint.atse.0.at="nexus0" +#hint.atse.0.maddr=0x7f007000 +#hint.atse.0.msize=0x540 # # Terasic Multi-touch LCD (MTL), an optional feature in DE-4 configurations. From owner-p4-projects@FreeBSD.ORG Wed Jan 2 10:10:07 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 75982562; Wed, 2 Jan 2013 10:10:07 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E8AB3560 for ; Wed, 2 Jan 2013 10:10:06 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id CD0B38FC08 for ; Wed, 2 Jan 2013 10:10:06 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r02AA6jP075588 for ; Wed, 2 Jan 2013 10:10:06 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r02AA6jF075585 for perforce@freebsd.org; Wed, 2 Jan 2013 10:10:06 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Wed, 2 Jan 2013 10:10:06 GMT Message-Id: <201301021010.r02AA6jF075585@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219935 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2013 10:10:07 -0000 http://p4web.freebsd.org/@@219935?ac=10 Change 219935 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/02 10:09:18 Initialise Openfirmware/FDT code earlier in the FreeBSD/beri boot, so that the results will be available for configuring the console UART (eventually). Suggested by: thompsa Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/mips/beri/beri_machdep.c#7 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/mips/beri/beri_machdep.c#7 (text+ko) ==== @@ -87,17 +87,6 @@ { int i; -#ifdef FDT -#ifndef FDT_DTB_STATIC -#error "mips_init with FDT requires FDT_DTB_STATIC" -#endif - - if (OF_install(OFW_FDT, 0) == FALSE) - while (1); - if (OF_init(&fdt_static_dtb) != 0) - while (1); -#endif - for (i = 0; i < 10; i++) { phys_avail[i] = 0; } @@ -156,6 +145,17 @@ mips_pcpu0_init(); +#ifdef FDT +#ifndef FDT_DTB_STATIC +#error "mips_init with FDT requires FDT_DTB_STATIC" +#endif + + if (OF_install(OFW_FDT, 0) == FALSE) + while (1); + if (OF_init(&fdt_static_dtb) != 0) + while (1); +#endif + /* * XXXRW: We have no way to compare wallclock time to cycle rate on * BERI, so for now assume we run at the MALTA default (100MHz). From owner-p4-projects@FreeBSD.ORG Wed Jan 2 10:58:58 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5C953BB8; Wed, 2 Jan 2013 10:58:58 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18ACFBB6 for ; Wed, 2 Jan 2013 10:58:58 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id E8CDB8FC17 for ; Wed, 2 Jan 2013 10:58:57 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r02AwvKM078145 for ; Wed, 2 Jan 2013 10:58:57 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r02Awv3r078142 for perforce@freebsd.org; Wed, 2 Jan 2013 10:58:57 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Wed, 2 Jan 2013 10:58:57 GMT Message-Id: <201301021058.r02Awv3r078142@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219936 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2013 10:58:58 -0000 http://p4web.freebsd.org/@@219936?ac=10 Change 219936 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/02 10:58:46 Avoid collisions when numbering avgen devices; due to an existing collision, we weren't properly setting up /dev/de4bsw. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_DE4.hints#16 edit .. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_FDT_DE4.hints#7 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_DE4.hints#16 (text+ko) ==== @@ -61,26 +61,26 @@ hint.altera_avgen.0.devname="berirom" # +# Expose the DE4 buttons and switches via an Avalon "generic" device. +# +hint.altera_avgen.1.at="nexus0" +hint.altera_avgen.1.maddr=0x7f009000 +hint.altera_avgen.1.msize=2 +hint.altera_avgen.1.width=1 +hint.altera_avgen.1.fileio="r" +hint.altera_avgen.1.devname="de4bsw" + +# # Expose the DE4 flash via an Avalon "generic" device. # This is incompatible with the isf(4) driver. # -#hint.altera_avgen.0.at="nexus0" -#hint.altera_avgen.0.maddr=0x74000000 -#hint.altera_avgen.0.msize=0x4000000 -#hint.altera_avgen.0.width=2 -#hint.altera_avgen.0.fileio="rw" -#hint.altera_avgen.0.mmapio="rwx" -#hint.altera_avgen.0.devname="de4flash" - -# -# Expose the DE4 buttons and switches via an Avalon "generic" device. -# -hint.altera_avgen.0.at="nexus0" -hint.altera_avgen.0.maddr=0x7f009000 -hint.altera_avgen.0.msize=2 -hint.altera_avgen.0.width=1 -hint.altera_avgen.0.fileio="r" -hint.altera_avgen.0.devname="de4bsw" +#hint.altera_avgen.2.at="nexus0" +#hint.altera_avgen.2.maddr=0x74000000 +#hint.altera_avgen.2.msize=0x4000000 +#hint.altera_avgen.2.width=2 +#hint.altera_avgen.2.fileio="rw" +#hint.altera_avgen.2.mmapio="rwx" +#hint.altera_avgen.2.devname="de4flash" # # General Intel StrataFlash driver ==== //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_FDT_DE4.hints#7 (text+ko) ==== @@ -61,26 +61,26 @@ hint.altera_avgen.0.devname="berirom" # +# Expose the DE4 buttons and switches via an Avalon "generic" device. +# +hint.altera_avgen.1.at="nexus0" +hint.altera_avgen.1.maddr=0x7f009000 +hint.altera_avgen.1.msize=2 +hint.altera_avgen.1.width=1 +hint.altera_avgen.1.fileio="r" +hint.altera_avgen.1.devname="de4bsw" + +# # Expose the DE4 flash via an Avalon "generic" device. # This is incompatible with the isf(4) driver. # -#hint.altera_avgen.0.at="nexus0" -#hint.altera_avgen.0.maddr=0x74000000 -#hint.altera_avgen.0.msize=0x4000000 -#hint.altera_avgen.0.width=2 -#hint.altera_avgen.0.fileio="rw" -#hint.altera_avgen.0.mmapio="rwx" -#hint.altera_avgen.0.devname="de4flash" - -# -# Expose the DE4 buttons and switches via an Avalon "generic" device. -# -hint.altera_avgen.0.at="nexus0" -hint.altera_avgen.0.maddr=0x7f009000 -hint.altera_avgen.0.msize=2 -hint.altera_avgen.0.width=1 -hint.altera_avgen.0.fileio="r" -hint.altera_avgen.0.devname="de4bsw" +#hint.altera_avgen.2.at="nexus0" +#hint.altera_avgen.2.maddr=0x74000000 +#hint.altera_avgen.2.msize=0x4000000 +#hint.altera_avgen.2.width=2 +#hint.altera_avgen.2.fileio="rw" +#hint.altera_avgen.2.mmapio="rwx" +#hint.altera_avgen.2.devname="de4flash" # # General Intel StrataFlash driver From owner-p4-projects@FreeBSD.ORG Wed Jan 2 16:02:13 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 28AF81A7; Wed, 2 Jan 2013 16:02:13 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D961B1A5 for ; Wed, 2 Jan 2013 16:02:12 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id A8E441551 for ; Wed, 2 Jan 2013 16:02:12 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r02G2B0g092209 for ; Wed, 2 Jan 2013 16:02:11 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r02G2BJK092206 for perforce@freebsd.org; Wed, 2 Jan 2013 16:02:11 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Wed, 2 Jan 2013 16:02:11 GMT Message-Id: <201301021602.r02G2BJK092206@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219937 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2013 16:02:13 -0000 http://p4web.freebsd.org/@@219937?ac=10 Change 219937 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/02 16:02:08 Copy Terasic MTL nexus bus attachment as a starting point for an FDT attachment for the same driver. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/mtl/terasic_mtl_fdt.c#1 branch Differences ... From owner-p4-projects@FreeBSD.ORG Wed Jan 2 23:39:05 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8330C8D5; Wed, 2 Jan 2013 23:39:05 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3CEA88D3 for ; Wed, 2 Jan 2013 23:39:05 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 20746A40 for ; Wed, 2 Jan 2013 23:39:05 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r02Nd4l2012957 for ; Wed, 2 Jan 2013 23:39:04 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r02Nd4t4012954 for perforce@freebsd.org; Wed, 2 Jan 2013 23:39:04 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Wed, 2 Jan 2013 23:39:04 GMT Message-Id: <201301022339.r02Nd4t4012954@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219938 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2013 23:39:05 -0000 http://p4web.freebsd.org/@@219938?ac=10 Change 219938 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/02 23:38:54 Write FDT attachment for the Terasic MTL (multitouch LCD) driver. Exploit the fact that FDT allows multiple memory ranges to be assigned to a device, giving us a cleaner description than device.hints does. Use FDT instead of device.hints for mtl0. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-de4.dts#9 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/mtl/terasic_mtl_fdt.c#2 edit .. //depot/projects/ctsrd/beribsd/src/sys/mips/beri/files.beri#26 edit .. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_FDT_DE4.hints#8 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-de4.dts#9 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Robert N. M. Watson + * Copyright (c) 2012-2013 Robert N. M. Watson * All rights reserved. * * This software was developed by SRI International and the University of @@ -100,14 +100,12 @@ reg = <0x7f007000 0x540>; }; -/* touchscreen@70400000 { compatible = "cambridge,mtl"; reg = <0x70400000 0x1000 0x70000000 0x177000 0x70177000 0x2000>; }; -*/ flash@0x74000000 { compatible = "intel,strataflash"; ==== //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/mtl/terasic_mtl_fdt.c#2 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Robert N. M. Watson + * Copyright (c) 2012-2013 Robert N. M. Watson * All rights reserved. * * This software was developed by SRI International and the University of @@ -48,22 +48,28 @@ #include #include +#include +#include +#include +#include + #include static int -terasic_mtl_nexus_probe(device_t dev) +terasic_mtl_fdt_probe(device_t dev) { - device_set_desc(dev, "Terasic Multi-touch LCD (MTL)"); - return (BUS_PROBE_DEFAULT); + if (ofw_bus_is_compatible(dev, "cambridge,mtl")) { + device_set_desc(dev, "Terasic Multi-touch LCD (MTL)"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); } static int -terasic_mtl_nexus_attach(device_t dev) +terasic_mtl_fdt_attach(device_t dev) { struct terasic_mtl_softc *sc; - u_long pixel_maddr, text_maddr, reg_maddr; - u_long pixel_msize, text_msize, reg_msize; int error; sc = device_get_softc(dev); @@ -71,80 +77,80 @@ sc->mtl_unit = device_get_unit(dev); /* - * Query non-standard hints to find the locations of our two memory - * regions. Enforce certain alignment and size requirements. + * FDT allows multiple memory resources to be defined for a device; + * query them in the order registers, pixel buffer, text buffer. + * However, we need to sanity-check that they are page-aligned and + * page-sized, so we may still abort. */ - if (resource_long_value(device_get_name(dev), device_get_unit(dev), - "reg_maddr", ®_maddr) != 0 || (reg_maddr % PAGE_SIZE != 0)) { + sc->mtl_reg_rid = 0; + sc->mtl_reg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->mtl_reg_rid, RF_ACTIVE); + if (sc->mtl_reg_res == NULL) { + device_printf(dev, "couldn't map register memory\n"); + error = ENXIO; + goto error; + } + if (rman_get_start(sc->mtl_reg_res) % PAGE_SIZE != 0) { device_printf(dev, "improper register address"); - return (ENXIO); + error = ENXIO; + goto error; } - if (resource_long_value(device_get_name(dev), device_get_unit(dev), - "reg_msize", ®_msize) != 0 || (reg_msize % PAGE_SIZE != 0)) { + if (rman_get_size(sc->mtl_reg_res) % PAGE_SIZE != 0) { device_printf(dev, "improper register size"); - return (ENXIO); - } - if (resource_long_value(device_get_name(dev), device_get_unit(dev), - "pixel_maddr", &pixel_maddr) != 0 || - (pixel_maddr % PAGE_SIZE != 0)) { - device_printf(dev, "improper pixel frame buffer address"); - return (ENXIO); - } - if (resource_long_value(device_get_name(dev), device_get_unit(dev), - "pixel_msize", &pixel_msize) != 0 || - (pixel_msize % PAGE_SIZE != 0)) { - device_printf(dev, "improper pixel frame buffer size"); - return (ENXIO); - } - if (resource_long_value(device_get_name(dev), device_get_unit(dev), - "text_maddr", &text_maddr) != 0 || - (text_maddr % PAGE_SIZE != 0)) { - device_printf(dev, "improper text frame buffer address"); - return (ENXIO); - } - if (resource_long_value(device_get_name(dev), device_get_unit(dev), - "text_msize", &text_msize) != 0 || - (text_msize % PAGE_SIZE != 0)) { - device_printf(dev, "improper text frame buffer size"); - return (ENXIO); - } - - /* - * Allocate resources. - */ - sc->mtl_reg_rid = 0; - sc->mtl_reg_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->mtl_reg_rid, reg_maddr, reg_maddr + reg_msize - 1, - reg_msize, RF_ACTIVE); - if (sc->mtl_reg_res == NULL) { - device_printf(dev, "couldn't map register memory\n"); error = ENXIO; goto error; } device_printf(sc->mtl_dev, "registers at mem %p-%p\n", - (void *)reg_maddr, (void *)(reg_maddr + reg_msize)); - sc->mtl_pixel_rid = 0; - sc->mtl_pixel_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->mtl_pixel_rid, pixel_maddr, pixel_maddr + pixel_msize - 1, - pixel_msize, RF_ACTIVE); + (void *)rman_get_start(sc->mtl_reg_res), + (void *)(rman_get_start(sc->mtl_reg_res) + + rman_get_size(sc->mtl_reg_res))); + + sc->mtl_pixel_rid = 1; + sc->mtl_pixel_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->mtl_pixel_rid, RF_ACTIVE); if (sc->mtl_pixel_res == NULL) { device_printf(dev, "couldn't map pixel memory\n"); error = ENXIO; goto error; } + if (rman_get_start(sc->mtl_pixel_res) % PAGE_SIZE != 0) { + device_printf(dev, "improper pixel address"); + error = ENXIO; + goto error; + } + if (rman_get_size(sc->mtl_pixel_res) % PAGE_SIZE != 0) { + device_printf(dev, "improper pixel size"); + error = ENXIO; + goto error; + } device_printf(sc->mtl_dev, "pixel frame buffer at mem %p-%p\n", - (void *)pixel_maddr, (void *)(pixel_maddr + pixel_msize)); - sc->mtl_text_rid = 0; - sc->mtl_text_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->mtl_text_rid, text_maddr, text_maddr + text_msize - 1, - text_msize, RF_ACTIVE); + (void *)rman_get_start(sc->mtl_pixel_res), + (void *)(rman_get_start(sc->mtl_pixel_res) + + rman_get_size(sc->mtl_pixel_res))); + + sc->mtl_text_rid = 2; + sc->mtl_text_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->mtl_text_rid, RF_ACTIVE); if (sc->mtl_text_res == NULL) { device_printf(dev, "couldn't map text memory\n"); error = ENXIO; goto error; } + if (rman_get_start(sc->mtl_text_res) % PAGE_SIZE != 0) { + device_printf(dev, "improper text address"); + error = ENXIO; + goto error; + } + if (rman_get_size(sc->mtl_text_res) % PAGE_SIZE != 0) { + device_printf(dev, "improper text size"); + error = ENXIO; + goto error; + } device_printf(sc->mtl_dev, "text frame buffer at mem %p-%p\n", - (void *)text_maddr, (void *)(text_maddr + text_msize)); + (void *)rman_get_start(sc->mtl_text_res), + (void *)(rman_get_start(sc->mtl_text_res) + + rman_get_size(sc->mtl_text_res))); + error = terasic_mtl_attach(sc); if (error == 0) return (0); @@ -162,7 +168,7 @@ } static int -terasic_mtl_nexus_detach(device_t dev) +terasic_mtl_fdt_detach(device_t dev) { struct terasic_mtl_softc *sc; @@ -177,20 +183,20 @@ return (0); } -static device_method_t terasic_mtl_nexus_methods[] = { - DEVMETHOD(device_probe, terasic_mtl_nexus_probe), - DEVMETHOD(device_attach, terasic_mtl_nexus_attach), - DEVMETHOD(device_detach, terasic_mtl_nexus_detach), +static device_method_t terasic_mtl_fdt_methods[] = { + DEVMETHOD(device_probe, terasic_mtl_fdt_probe), + DEVMETHOD(device_attach, terasic_mtl_fdt_attach), + DEVMETHOD(device_detach, terasic_mtl_fdt_detach), { 0, 0 } }; -static driver_t terasic_mtl_nexus_driver = { +static driver_t terasic_mtl_fdt_driver = { "terasic_mtl", - terasic_mtl_nexus_methods, + terasic_mtl_fdt_methods, sizeof(struct terasic_mtl_softc), }; static devclass_t terasic_mtl_devclass; -DRIVER_MODULE(mtl, nexus, terasic_mtl_nexus_driver, terasic_mtl_devclass, 0, +DRIVER_MODULE(mtl, simplebus, terasic_mtl_fdt_driver, terasic_mtl_devclass, 0, 0); ==== //depot/projects/ctsrd/beribsd/src/sys/mips/beri/files.beri#26 (text+ko) ==== @@ -8,6 +8,7 @@ dev/terasic/de4led/terasic_de4led_fdt.c optional terasic_de4led fdt dev/terasic/de4led/terasic_de4led_nexus.c optional terasic_de4led dev/terasic/mtl/terasic_mtl.c optional terasic_mtl +dev/terasic/mtl/terasic_mtl_fdt.c optional terasic_mtl fdt dev/terasic/mtl/terasic_mtl_nexus.c optional terasic_mtl dev/terasic/mtl/terasic_mtl_pixel.c optional terasic_mtl dev/terasic/mtl/terasic_mtl_reg.c optional terasic_mtl ==== //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_FDT_DE4.hints#8 (text+ko) ==== @@ -42,13 +42,13 @@ # # Terasic Multi-touch LCD (MTL), an optional feature in DE-4 configurations. # -hint.terasic_mtl.0.at="nexus0" -hint.terasic_mtl.0.reg_maddr=0x70400000 -hint.terasic_mtl.0.reg_msize=0x1000 -hint.terasic_mtl.0.pixel_maddr=0x70000000 -hint.terasic_mtl.0.pixel_msize=0x177000 -hint.terasic_mtl.0.text_maddr=0x70177000 -hint.terasic_mtl.0.text_msize=0x2000 +#hint.terasic_mtl.0.at="nexus0" +#hint.terasic_mtl.0.reg_maddr=0x70400000 +#hint.terasic_mtl.0.reg_msize=0x1000 +#hint.terasic_mtl.0.pixel_maddr=0x70000000 +#hint.terasic_mtl.0.pixel_msize=0x177000 +#hint.terasic_mtl.0.text_maddr=0x70177000 +#hint.terasic_mtl.0.text_msize=0x2000 # # BERI Hardware Version ROM From owner-p4-projects@FreeBSD.ORG Thu Jan 3 07:03:59 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B7E11361; Thu, 3 Jan 2013 07:03:59 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6EF5E35F for ; Thu, 3 Jan 2013 07:03:59 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 5F71D171 for ; Thu, 3 Jan 2013 07:03:59 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r0373xdF032817 for ; Thu, 3 Jan 2013 07:03:59 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r0373woM032814 for perforce@freebsd.org; Thu, 3 Jan 2013 07:03:58 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Thu, 3 Jan 2013 07:03:58 GMT Message-Id: <201301030703.r0373woM032814@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219939 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2013 07:04:00 -0000 http://p4web.freebsd.org/@@219939?ac=10 Change 219939 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/03 07:03:23 Start restructring of altera_avgen(4) so that it can have an FDT attachment -- this requires first properly breaking out the current nexus attachment from the driver implementation. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/avgen/altera_avgen_nexus.c#1 branch Differences ... From owner-p4-projects@FreeBSD.ORG Thu Jan 3 13:04:13 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E334939F; Thu, 3 Jan 2013 13:04:12 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9B70039D for ; Thu, 3 Jan 2013 13:04:12 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 7C67D727 for ; Thu, 3 Jan 2013 13:04:12 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r03D4CBa049616 for ; Thu, 3 Jan 2013 13:04:12 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r03D4B5u049613 for perforce@freebsd.org; Thu, 3 Jan 2013 13:04:11 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Thu, 3 Jan 2013 13:04:11 GMT Message-Id: <201301031304.r03D4B5u049613@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219940 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2013 13:04:13 -0000 http://p4web.freebsd.org/@@219940?ac=10 Change 219940 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/03 13:03:38 Rework altera_avgen(4) to cleanly(ish) separate nexus bus attachment from the driver itself. This should allow us to plug in an fdt attachment more easily. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/conf/files#12 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/avgen/altera_avgen.c#8 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/avgen/altera_avgen.h#4 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/avgen/altera_avgen_nexus.c#2 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/conf/files#12 (text+ko) ==== @@ -638,6 +638,7 @@ dev/alc/if_alc.c optional alc pci dev/ale/if_ale.c optional ale pci dev/altera/avgen/altera_avgen.c optional altera_avgen +dev/altera/avgen/altera_avgen_nexus.c optional altera_avgen dev/altera/sdcard/altera_sdcard.c optional altera_sdcard dev/altera/sdcard/altera_sdcard_disk.c optional altera_sdcard dev/altera/sdcard/altera_sdcard_io.c optional altera_sdcard ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/avgen/altera_avgen.c#8 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Robert N. M. Watson + * Copyright (c) 2012-2013 Robert N. M. Watson * All rights reserved. * * This software was developed by SRI International and the University of @@ -226,13 +226,6 @@ return (0); } -static int -altera_avgen_nexus_probe(device_t dev) -{ - - device_set_desc(dev, "Generic Altera Avalon device attachment"); - return (BUS_PROBE_DEFAULT); -} static int altera_avgen_process_options(struct altera_avgen_softc *sc, @@ -321,42 +314,14 @@ return (0); } -static int -altera_avgen_nexus_attach(device_t dev) +int +altera_avgen_attach(struct altera_avgen_softc *sc, const char *str_fileio, + const char *str_mmapio, const char *str_devname, int devunit) { - struct altera_avgen_softc *sc; - const char *str_fileio, *str_mmapio; - const char *str_devname; + device_t dev = sc->avg_dev; char devname[SPECNAMELEN + 1]; - int devunit, error; - - sc = device_get_softc(dev); - sc->avg_dev = dev; - sc->avg_unit = device_get_unit(dev); + int error; - /* - * Query non-standard hints to find out what operations are permitted - * on the device, and whether it is cached. - */ - str_fileio = NULL; - str_mmapio = NULL; - str_devname = NULL; - devunit = -1; - sc->avg_width = 1; - error = resource_int_value(device_get_name(dev), device_get_unit(dev), - ALTERA_AVALON_STR_WIDTH, &sc->avg_width); - if (error != 0 && error != ENOENT) { - device_printf(dev, "invalid %s\n", ALTERA_AVALON_STR_WIDTH); - return (error); - } - (void)resource_string_value(device_get_name(dev), - device_get_unit(dev), ALTERA_AVALON_STR_FILEIO, &str_fileio); - (void)resource_string_value(device_get_name(dev), - device_get_unit(dev), ALTERA_AVALON_STR_MMAPIO, &str_mmapio); - (void)resource_string_value(device_get_name(dev), - device_get_unit(dev), ALTERA_AVALON_STR_DEVNAME, &str_devname); - (void)resource_int_value(device_get_name(dev), device_get_unit(dev), - ALTERA_AVALON_STR_DEVUNIT, &devunit); error = altera_avgen_process_options(sc, str_fileio, str_mmapio, str_devname, devunit); if (error) @@ -374,25 +339,15 @@ snprintf(devname, sizeof(devname), "%s%d", "avgen", sc->avg_unit); - /* Memory allocation and checking. */ - sc->avg_rid = 0; - sc->avg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->avg_rid, RF_ACTIVE); - if (sc->avg_res == NULL) { - device_printf(dev, "couldn't map memory\n"); - return (ENXIO); - } if (rman_get_size(sc->avg_res) >= PAGE_SIZE || str_mmapio != NULL) { if (rman_get_size(sc->avg_res) % PAGE_SIZE != 0) { device_printf(dev, "memory region not even multiple of page size\n"); - error = ENXIO; - goto error; + return (ENXIO); } if (rman_get_start(sc->avg_res) % PAGE_SIZE != 0) { device_printf(dev, "memory region not page-aligned\n"); - error = ENXIO; - goto error; + return (ENXIO); } } @@ -409,43 +364,16 @@ GID_WHEEL, S_IRUSR | S_IWUSR, str_devname); if (sc->avg_cdev == NULL) { device_printf(sc->avg_dev, "%s: make_dev failed\n", __func__); - error = ENXIO; - goto error; + return (ENXIO); } /* XXXRW: Slight race between make_dev(9) and here. */ sc->avg_cdev->si_drv1 = sc; return (0); - -error: - bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); - return (error); } -static int -altera_avgen_nexus_detach(device_t dev) +void +altera_avgen_detach(struct altera_avgen_softc *sc) { - struct altera_avgen_softc *sc; - sc = device_get_softc(dev); destroy_dev(sc->avg_cdev); - bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); - return (0); } - -static device_method_t altera_avgen_nexus_methods[] = { - DEVMETHOD(device_probe, altera_avgen_nexus_probe), - DEVMETHOD(device_attach, altera_avgen_nexus_attach), - DEVMETHOD(device_detach, altera_avgen_nexus_detach), - { 0, 0 } -}; - -static driver_t altera_avgen_nexus_driver = { - "altera_avgen", - altera_avgen_nexus_methods, - sizeof(struct altera_avgen_softc), -}; - -static devclass_t altera_avgen_devclass; - -DRIVER_MODULE(avgen, nexus, altera_avgen_nexus_driver, altera_avgen_devclass, - 0, 0); ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/avgen/altera_avgen.h#4 (text+ko) ==== @@ -77,7 +77,9 @@ /* * Driver setup routines from the bus attachment/teardown. */ -int altera_avgen_attach(struct altera_avgen_softc *sc); +int altera_avgen_attach(struct altera_avgen_softc *sc, + const char *str_fileio, const char *str_mmapio, + const char *str_devname, int devunit); void altera_avgen_detach(struct altera_avgen_softc *sc); #endif /* _DEV_ALTERA_AVALON_H_ */ ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/avgen/altera_avgen_nexus.c#2 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Robert N. M. Watson + * Copyright (c) 2012-2013 Robert N. M. Watson * All rights reserved. * * This software was developed by SRI International and the University of @@ -53,179 +53,6 @@ #include -/* - * Generic device driver for allowing read(), write(), and mmap() on - * memory-mapped, Avalon-attached devices. There is no actual dependence on - * Avalon, so conceivably this should just be soc_dev or similar, since many - * system-on-chip bus environments would work fine with the same code. - */ - -static d_mmap_t altera_avgen_mmap; -static d_read_t altera_avgen_read; -static d_write_t altera_avgen_write; - -static struct cdevsw avg_cdevsw = { - .d_version = D_VERSION, - .d_mmap = altera_avgen_mmap, - .d_read = altera_avgen_read, - .d_write = altera_avgen_write, - .d_name = "altera_avgen", -}; - -static int -altera_avgen_read(struct cdev *dev, struct uio *uio, int flag) -{ - struct altera_avgen_softc *sc; - u_long offset, size; -#ifdef NOTYET - uint64_t v8; -#endif - uint32_t v4; - uint16_t v2; - uint8_t v1; - u_int width; - int error; - - sc = dev->si_drv1; - if ((sc->avg_flags & ALTERA_AVALON_FLAG_READ) == 0) - return (EACCES); - width = sc->avg_width; - if (uio->uio_offset < 0 || uio->uio_offset % width != 0 || - uio->uio_resid % width != 0) - return (ENODEV); - size = rman_get_size(sc->avg_res); - if ((uio->uio_offset + uio->uio_resid < 0) || - (uio->uio_offset + uio->uio_resid > size)) - return (ENODEV); - while (uio->uio_resid > 0) { - offset = uio->uio_offset; - if (offset + width > size) - return (ENODEV); - switch (width) { - case 1: - v1 = bus_read_1(sc->avg_res, offset); - error = uiomove(&v1, sizeof(v1), uio); - break; - - case 2: - v2 = bus_read_2(sc->avg_res, offset); - error = uiomove(&v2, sizeof(v2), uio); - break; - - case 4: - v4 = bus_read_4(sc->avg_res, offset); - error = uiomove(&v4, sizeof(v4), uio); - break; - -#ifdef NOTYET - case 8: - v8 = bus_read_8(sc->avg_res, offset); - error = uiomove(&v8, sizeof(v8), uio); - break; - -#endif - - default: - panic("%s: unexpected widthment %u", __func__, width); - } - if (error) - return (error); - } - return (0); -} - -static int -altera_avgen_write(struct cdev *dev, struct uio *uio, int flag) -{ - struct altera_avgen_softc *sc; - u_long offset, size; -#ifdef NOTYET - uint64_t v8; -#endif - uint32_t v4; - uint16_t v2; - uint8_t v1; - u_int width; - int error; - - sc = dev->si_drv1; - if ((sc->avg_flags & ALTERA_AVALON_FLAG_WRITE) == 0) - return (EACCES); - width = sc->avg_width; - if (uio->uio_offset < 0 || uio->uio_offset % width != 0 || - uio->uio_resid % width != 0) - return (ENODEV); - size = rman_get_size(sc->avg_res); - while (uio->uio_resid > 0) { - offset = uio->uio_offset; - if (offset + width > size) - return (ENODEV); - switch (width) { - case 1: - error = uiomove(&v1, sizeof(v1), uio); - if (error) - return (error); - bus_write_1(sc->avg_res, offset, v1); - break; - - case 2: - error = uiomove(&v2, sizeof(v2), uio); - if (error) - return (error); - bus_write_2(sc->avg_res, offset, v2); - break; - - case 4: - error = uiomove(&v4, sizeof(v4), uio); - if (error) - return (error); - bus_write_4(sc->avg_res, offset, v4); - break; - -#ifdef NOTYET - case 8: - error = uiomove(&v8, sizeof(v8), uio); - if (error) - return (error); - bus_write_8(sc->avg_res, offset, v8); - break; -#endif - - default: - panic("%s: unexpected width %u", __func__, width); - } - } - return (0); -} - -static int -altera_avgen_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, - int nprot, vm_memattr_t *memattr) -{ - struct altera_avgen_softc *sc; - - sc = dev->si_drv1; - if (nprot & VM_PROT_READ) { - if ((sc->avg_flags & ALTERA_AVALON_FLAG_MMAP_READ) == 0) - return (EACCES); - } - if (nprot & VM_PROT_WRITE) { - if ((sc->avg_flags & ALTERA_AVALON_FLAG_MMAP_WRITE) == 0) - return (EACCES); - } - if (nprot & VM_PROT_EXECUTE) { - if ((sc->avg_flags & ALTERA_AVALON_FLAG_MMAP_EXEC) == 0) - return (EACCES); - } - if (trunc_page(offset) == offset && - rman_get_size(sc->avg_res) >= offset + PAGE_SIZE) { - *paddr = rman_get_start(sc->avg_res) + offset; - *memattr = VM_MEMATTR_UNCACHEABLE; - } else - return (ENODEV); - return (0); -} - static int altera_avgen_nexus_probe(device_t dev) { @@ -235,99 +62,11 @@ } static int -altera_avgen_process_options(struct altera_avgen_softc *sc, - const char *str_fileio, const char *str_mmapio, const char *str_devname, - int devunit) -{ - const char *cp; - device_t dev = sc->avg_dev; - - /* - * Check for valid combinations of options. - */ - if (str_fileio == NULL && str_mmapio == NULL) { - device_printf(dev, - "at least one of %s or %s must be specified\n", - ALTERA_AVALON_STR_FILEIO, ALTERA_AVALON_STR_MMAPIO); - return (ENXIO); - } - if (str_devname == NULL && devunit != -1) { - device_printf(dev, "%s requires %s be specified\n", - ALTERA_AVALON_STR_DEVUNIT, ALTERA_AVALON_STR_DEVNAME); - return (ENXIO); - } - - /* - * Extract, digest, and save values. - */ - switch (sc->avg_width) { - case 1: - case 2: - case 4: -#ifdef NOTYET - case 8: -#endif - break; - - default: - device_printf(dev, "%s unsupported value %u\n", - ALTERA_AVALON_STR_WIDTH, sc->avg_width); - return (ENXIO); - } - sc->avg_flags = 0; - if (str_fileio != NULL) { - for (cp = str_fileio; *cp != '\0'; cp++) { - switch (*cp) { - case ALTERA_AVALON_CHAR_READ: - sc->avg_flags |= ALTERA_AVALON_FLAG_READ; - break; - - case ALTERA_AVALON_CHAR_WRITE: - sc->avg_flags |= ALTERA_AVALON_FLAG_WRITE; - break; - - default: - device_printf(dev, - "invalid %s character %c\n", - ALTERA_AVALON_STR_FILEIO, *cp); - return (ENXIO); - } - } - } - if (str_mmapio != NULL) { - for (cp = str_mmapio; *cp != '\0'; cp++) { - switch (*cp) { - case ALTERA_AVALON_CHAR_READ: - sc->avg_flags |= ALTERA_AVALON_FLAG_MMAP_READ; - break; - - case ALTERA_AVALON_CHAR_WRITE: - sc->avg_flags |= - ALTERA_AVALON_FLAG_MMAP_WRITE; - break; - - case ALTERA_AVALON_CHAR_EXEC: - sc->avg_flags |= ALTERA_AVALON_FLAG_MMAP_EXEC; - break; - - default: - device_printf(dev, - "invalid %s character %c\n", - ALTERA_AVALON_STR_MMAPIO, *cp); - return (ENXIO); - } - } - } - return (0); -} - -static int altera_avgen_nexus_attach(device_t dev) { struct altera_avgen_softc *sc; const char *str_fileio, *str_mmapio; const char *str_devname; - char devname[SPECNAMELEN + 1]; int devunit, error; sc = device_get_softc(dev); @@ -357,22 +96,6 @@ device_get_unit(dev), ALTERA_AVALON_STR_DEVNAME, &str_devname); (void)resource_int_value(device_get_name(dev), device_get_unit(dev), ALTERA_AVALON_STR_DEVUNIT, &devunit); - error = altera_avgen_process_options(sc, str_fileio, str_mmapio, - str_devname, devunit); - if (error) - return (error); - - /* Select a device name. */ - if (str_devname != NULL) { - if (devunit != -1) - (void)snprintf(devname, sizeof(devname), "%s%d", - str_devname, devunit); - else - (void)snprintf(devname, sizeof(devname), "%s", - str_devname); - } else - snprintf(devname, sizeof(devname), "%s%d", "avgen", - sc->avg_unit); /* Memory allocation and checking. */ sc->avg_rid = 0; @@ -382,42 +105,11 @@ device_printf(dev, "couldn't map memory\n"); return (ENXIO); } - if (rman_get_size(sc->avg_res) >= PAGE_SIZE || str_mmapio != NULL) { - if (rman_get_size(sc->avg_res) % PAGE_SIZE != 0) { - device_printf(dev, - "memory region not even multiple of page size\n"); - error = ENXIO; - goto error; - } - if (rman_get_start(sc->avg_res) % PAGE_SIZE != 0) { - device_printf(dev, "memory region not page-aligned\n"); - error = ENXIO; - goto error; - } - } - - /* Device node allocation. */ - if (str_devname == NULL) { - str_devname = "altera_avgen%d"; - devunit = sc->avg_unit; - } - if (devunit != -1) - sc->avg_cdev = make_dev(&avg_cdevsw, sc->avg_unit, UID_ROOT, - GID_WHEEL, S_IRUSR | S_IWUSR, str_devname, devunit); - else - sc->avg_cdev = make_dev(&avg_cdevsw, sc->avg_unit, UID_ROOT, - GID_WHEEL, S_IRUSR | S_IWUSR, str_devname); - if (sc->avg_cdev == NULL) { - device_printf(sc->avg_dev, "%s: make_dev failed\n", __func__); - error = ENXIO; - goto error; - } - /* XXXRW: Slight race between make_dev(9) and here. */ - sc->avg_cdev->si_drv1 = sc; - return (0); - -error: - bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); + error = altera_avgen_attach(sc, str_fileio, str_mmapio, str_devname, + devunit); + if (error != 0) + bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, + sc->avg_res); return (error); } @@ -427,7 +119,7 @@ struct altera_avgen_softc *sc; sc = device_get_softc(dev); - destroy_dev(sc->avg_cdev); + altera_avgen_detach(sc); bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); return (0); } From owner-p4-projects@FreeBSD.ORG Thu Jan 3 13:37:48 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 26ACBCBC; Thu, 3 Jan 2013 13:37:48 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D54C5CBA for ; Thu, 3 Jan 2013 13:37:47 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id B8BA4889 for ; Thu, 3 Jan 2013 13:37:47 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r03Dblk1051361 for ; Thu, 3 Jan 2013 13:37:47 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r03DblBE051358 for perforce@freebsd.org; Thu, 3 Jan 2013 13:37:47 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Thu, 3 Jan 2013 13:37:47 GMT Message-Id: <201301031337.r03DblBE051358@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219941 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2013 13:37:48 -0000 http://p4web.freebsd.org/@@219941?ac=10 Change 219941 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/03 13:37:46 Copy altera_avgen(4) nexus attachment as a starting point for an FDT attachment. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/avgen/altera_avgen_fdt.c#1 branch Differences ... From owner-p4-projects@FreeBSD.ORG Thu Jan 3 15:19:34 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F399B653; Thu, 3 Jan 2013 15:19:33 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ABBC5651 for ; Thu, 3 Jan 2013 15:19:33 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 8EEA7E7D for ; Thu, 3 Jan 2013 15:19:33 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r03FJXGw055756 for ; Thu, 3 Jan 2013 15:19:33 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r03FJWEf055753 for perforce@freebsd.org; Thu, 3 Jan 2013 15:19:32 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Thu, 3 Jan 2013 15:19:32 GMT Message-Id: <201301031519.r03FJWEf055753@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219942 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2013 15:19:34 -0000 http://p4web.freebsd.org/@@219942?ac=10 Change 219942 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/03 15:19:07 Implement an FDT attachment for altera_avgen(4), and switch over the FDT reference kernel from using device.hints to FDT to configure its berirom and de4bsw device nodes. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-de4.dts#10 edit .. //depot/projects/ctsrd/beribsd/src/sys/conf/files#13 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/avgen/altera_avgen_fdt.c#2 edit .. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_FDT_DE4.hints#9 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-de4.dts#10 (text+ko) ==== @@ -116,5 +116,21 @@ compatible = "intel,strataflash"; reg = <0x76000000 0x2000000>; }; + + avgen@0x7f009000 { + compatible = "sri-cambridge,avgen"; + reg = <0x7f009000 0x2>; + sri-cambridge,width = <1>; + sri-cambridge,fileio = "r"; + sri-cambridge,devname = "de4bsw"; + }; + + avgen@0x7f00a000 { + compatible = "sri-cambridge,avgen"; + reg = <0x7f00a000 0x14>; + sri-cambridge,width = <4>; + sri-cambridge,fileio = "rw"; + sri-cambridge,devname = "berirom"; + }; }; }; ==== //depot/projects/ctsrd/beribsd/src/sys/conf/files#13 (text+ko) ==== @@ -638,6 +638,7 @@ dev/alc/if_alc.c optional alc pci dev/ale/if_ale.c optional ale pci dev/altera/avgen/altera_avgen.c optional altera_avgen +dev/altera/avgen/altera_avgen_fdt.c optional altera_avgen fdt dev/altera/avgen/altera_avgen_nexus.c optional altera_avgen dev/altera/sdcard/altera_sdcard.c optional altera_sdcard dev/altera/sdcard/altera_sdcard_disk.c optional altera_sdcard ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/avgen/altera_avgen_fdt.c#2 (text+ko) ==== @@ -51,22 +51,32 @@ #include +#include +#include +#include +#include + #include static int -altera_avgen_nexus_probe(device_t dev) +altera_avgen_fdt_probe(device_t dev) { - device_set_desc(dev, "Generic Altera Avalon device attachment"); - return (BUS_PROBE_DEFAULT); + if (ofw_bus_is_compatible(dev, "sri-cambridge,avgen")) { + device_set_desc(dev, "Generic Altera Avalon device attachment"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); } static int -altera_avgen_nexus_attach(device_t dev) +altera_avgen_fdt_attach(device_t dev) { struct altera_avgen_softc *sc; - const char *str_fileio, *str_mmapio; - const char *str_devname; + char *str_fileio, *str_mmapio; + char *str_devname; + phandle_t node; + pcell_t cell; int devunit, error; sc = device_get_softc(dev); @@ -74,28 +84,25 @@ sc->avg_unit = device_get_unit(dev); /* - * Query non-standard hints to find out what operations are permitted - * on the device, and whether it is cached. + * Query driver-specific OpenFirmware properties to determine how to + * expose the device via /dev. */ str_fileio = NULL; str_mmapio = NULL; str_devname = NULL; devunit = -1; sc->avg_width = 1; - error = resource_int_value(device_get_name(dev), device_get_unit(dev), - ALTERA_AVALON_STR_WIDTH, &sc->avg_width); - if (error != 0 && error != ENOENT) { - device_printf(dev, "invalid %s\n", ALTERA_AVALON_STR_WIDTH); - return (error); - } - (void)resource_string_value(device_get_name(dev), - device_get_unit(dev), ALTERA_AVALON_STR_FILEIO, &str_fileio); - (void)resource_string_value(device_get_name(dev), - device_get_unit(dev), ALTERA_AVALON_STR_MMAPIO, &str_mmapio); - (void)resource_string_value(device_get_name(dev), - device_get_unit(dev), ALTERA_AVALON_STR_DEVNAME, &str_devname); - (void)resource_int_value(device_get_name(dev), device_get_unit(dev), - ALTERA_AVALON_STR_DEVUNIT, &devunit); + node = ofw_bus_get_node(dev); + if (OF_getprop(node, "sri-cambridge,width", &cell, sizeof(cell)) > 0) + sc->avg_width = cell; + (void)OF_getprop_alloc(node, "sri-cambridge,fileio", sizeof(char), + (void **)&str_fileio); + (void)OF_getprop_alloc(node, "sri-cambridge,mmapio", sizeof(char), + (void **)&str_mmapio); + (void)OF_getprop_alloc(node, "sri-cambridge,devname", sizeof(char), + (void **)&str_devname); + if (OF_getprop(node, "sri-cambridge,devunit", &cell, sizeof(cell)) > 0) + devunit = cell; /* Memory allocation and checking. */ sc->avg_rid = 0; @@ -110,11 +117,17 @@ if (error != 0) bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); + if (str_fileio != NULL) + free(str_fileio, M_OFWPROP); + if (str_mmapio != NULL) + free(str_mmapio, M_OFWPROP); + if (str_devname != NULL) + free(str_devname, M_OFWPROP); return (error); } static int -altera_avgen_nexus_detach(device_t dev) +altera_avgen_fdt_detach(device_t dev) { struct altera_avgen_softc *sc; @@ -124,20 +137,20 @@ return (0); } -static device_method_t altera_avgen_nexus_methods[] = { - DEVMETHOD(device_probe, altera_avgen_nexus_probe), - DEVMETHOD(device_attach, altera_avgen_nexus_attach), - DEVMETHOD(device_detach, altera_avgen_nexus_detach), +static device_method_t altera_avgen_fdt_methods[] = { + DEVMETHOD(device_probe, altera_avgen_fdt_probe), + DEVMETHOD(device_attach, altera_avgen_fdt_attach), + DEVMETHOD(device_detach, altera_avgen_fdt_detach), { 0, 0 } }; -static driver_t altera_avgen_nexus_driver = { +static driver_t altera_avgen_fdt_driver = { "altera_avgen", - altera_avgen_nexus_methods, + altera_avgen_fdt_methods, sizeof(struct altera_avgen_softc), }; static devclass_t altera_avgen_devclass; -DRIVER_MODULE(avgen, nexus, altera_avgen_nexus_driver, altera_avgen_devclass, - 0, 0); +DRIVER_MODULE(avgen, simplebus, altera_avgen_fdt_driver, + altera_avgen_devclass, 0, 0); ==== //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_FDT_DE4.hints#9 (text+ko) ==== @@ -53,22 +53,22 @@ # # BERI Hardware Version ROM # -hint.altera_avgen.0.at="nexus0" -hint.altera_avgen.0.maddr=0x7F00A000 -hint.altera_avgen.0.msize=20 -hint.altera_avgen.0.width=4 -hint.altera_avgen.0.fileio="rw" -hint.altera_avgen.0.devname="berirom" +#hint.altera_avgen.0.at="nexus0" +#hint.altera_avgen.0.maddr=0x7F00A000 +#hint.altera_avgen.0.msize=20 +#hint.altera_avgen.0.width=4 +#hint.altera_avgen.0.fileio="rw" +#hint.altera_avgen.0.devname="berirom" # # Expose the DE4 buttons and switches via an Avalon "generic" device. # -hint.altera_avgen.1.at="nexus0" -hint.altera_avgen.1.maddr=0x7f009000 -hint.altera_avgen.1.msize=2 -hint.altera_avgen.1.width=1 -hint.altera_avgen.1.fileio="r" -hint.altera_avgen.1.devname="de4bsw" +#hint.altera_avgen.1.at="nexus0" +#hint.altera_avgen.1.maddr=0x7f009000 +#hint.altera_avgen.1.msize=2 +#hint.altera_avgen.1.width=1 +#hint.altera_avgen.1.fileio="r" +#hint.altera_avgen.1.devname="de4bsw" # # Expose the DE4 flash via an Avalon "generic" device. From owner-p4-projects@FreeBSD.ORG Thu Jan 3 15:20:35 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5E57A755; Thu, 3 Jan 2013 15:20:35 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 06F62753 for ; Thu, 3 Jan 2013 15:20:35 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id DC34EE8A for ; Thu, 3 Jan 2013 15:20:34 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r03FKYV5055798 for ; Thu, 3 Jan 2013 15:20:34 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r03FKYAh055795 for perforce@freebsd.org; Thu, 3 Jan 2013 15:20:34 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Thu, 3 Jan 2013 15:20:34 GMT Message-Id: <201301031520.r03FKYAh055795@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219943 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2013 15:20:35 -0000 http://p4web.freebsd.org/@@219943?ac=10 Change 219943 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/03 15:20:24 Garbage collect unused device.hints entries for devices now configured using FDT. This appears to be all of our BERI device drivers. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_FDT_DE4.hints#10 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_FDT_DE4.hints#10 (text+ko) ==== @@ -1,97 +1,5 @@ # $FreeBSD: src/sys/mips/conf/BERI_DE4.hints,v 1.5 2012/08/26 10:40:13 rwatson Exp $ -# -# Altera JTAG UARTs configured for console, debugging, and data putput on the -# Terasic DE-4. -# -#hint.altera_jtag_uart.0.at="nexus0" -#hint.altera_jtag_uart.0.maddr=0x7f000000 -#hint.altera_jtag_uart.0.msize=0x40 -#hint.altera_jtag_uart.0.irq=0 - -#hint.altera_jtag_uart.1.at="nexus0" -#hint.altera_jtag_uart.1.maddr=0x7f001000 -#hint.altera_jtag_uart.1.msize=0x40 - -#hint.altera_jtag_uart.2.at="nexus0" -#hint.altera_jtag_uart.2.maddr=0x7f002000 -#hint.altera_jtag_uart.2.msize=0x40 - -# -# On-board DE4 and tPad SD Card IP core -# -#hint.altera_sdcardc.0.at="nexus0" -#hint.altera_sdcardc.0.maddr=0x7f008000 -#hint.altera_sdcardc.0.msize=0x400 - -# -# On-board DE4 8-element LED -# -#hint.terasic_de4led.0.at="nexus0" -#hint.terasic_de4led.0.maddr=0x7f006000 -#hint.terasic_de4led.0.msize=1 -#hint.terasic_de4led.0.de4led_0_cmd="f9" - -# -# Altera Triple-Speed Ethernet Mac, present in tPad and DE-4 configurations -# -#hint.atse.0.at="nexus0" -#hint.atse.0.maddr=0x7f007000 -#hint.atse.0.msize=0x540 - -# -# Terasic Multi-touch LCD (MTL), an optional feature in DE-4 configurations. -# -#hint.terasic_mtl.0.at="nexus0" -#hint.terasic_mtl.0.reg_maddr=0x70400000 -#hint.terasic_mtl.0.reg_msize=0x1000 -#hint.terasic_mtl.0.pixel_maddr=0x70000000 -#hint.terasic_mtl.0.pixel_msize=0x177000 -#hint.terasic_mtl.0.text_maddr=0x70177000 -#hint.terasic_mtl.0.text_msize=0x2000 - -# -# BERI Hardware Version ROM -# -#hint.altera_avgen.0.at="nexus0" -#hint.altera_avgen.0.maddr=0x7F00A000 -#hint.altera_avgen.0.msize=20 -#hint.altera_avgen.0.width=4 -#hint.altera_avgen.0.fileio="rw" -#hint.altera_avgen.0.devname="berirom" - -# -# Expose the DE4 buttons and switches via an Avalon "generic" device. -# -#hint.altera_avgen.1.at="nexus0" -#hint.altera_avgen.1.maddr=0x7f009000 -#hint.altera_avgen.1.msize=2 -#hint.altera_avgen.1.width=1 -#hint.altera_avgen.1.fileio="r" -#hint.altera_avgen.1.devname="de4bsw" - -# -# Expose the DE4 flash via an Avalon "generic" device. -# This is incompatible with the isf(4) driver. -# -#hint.altera_avgen.2.at="nexus0" -#hint.altera_avgen.2.maddr=0x74000000 -#hint.altera_avgen.2.msize=0x4000000 -#hint.altera_avgen.2.width=2 -#hint.altera_avgen.2.fileio="rw" -#hint.altera_avgen.2.mmapio="rwx" -#hint.altera_avgen.2.devname="de4flash" - -# -# General Intel StrataFlash driver -# -#hint.isf.0.at="nexus0" -#hint.isf.0.maddr=0x74000000 -#hint.isf.0.msize=0x2000000 -#hint.isf.1.at="nexus0" -#hint.isf.1.maddr=0x76000000 -#hint.isf.1.msize=0x2000000 - # Reserved configuration blocks. Don't touch. hint.map.0.at="isf0" hint.map.0.start=0x00000000 From owner-p4-projects@FreeBSD.ORG Thu Jan 3 15:39:56 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6D386EFE; Thu, 3 Jan 2013 15:39:56 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 296C3EFC for ; Thu, 3 Jan 2013 15:39:56 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id F3CB1F4E for ; Thu, 3 Jan 2013 15:39:55 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r03FdtZF056299 for ; Thu, 3 Jan 2013 15:39:55 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r03Fdsq2056296 for perforce@freebsd.org; Thu, 3 Jan 2013 15:39:54 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Thu, 3 Jan 2013 15:39:54 GMT Message-Id: <201301031539.r03Fdsq2056296@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219944 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2013 15:39:56 -0000 http://p4web.freebsd.org/@@219944?ac=10 Change 219944 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/03 15:39:45 Consistently use the vendor name "sri-cambridge" for device compatibility strings. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-de4.dts#11 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/de4led/terasic_de4led_fdt.c#3 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/mtl/terasic_mtl_fdt.c#3 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-de4.dts#11 (text+ko) ==== @@ -91,7 +91,7 @@ }; led@7f006000 { - compatible = "cambridge,de4led"; + compatible = "sri-cambridge,de4led"; reg = <0x7f006000 0x1>; }; @@ -101,7 +101,7 @@ }; touchscreen@70400000 { - compatible = "cambridge,mtl"; + compatible = "sri-cambridge,mtl"; reg = <0x70400000 0x1000 0x70000000 0x177000 0x70177000 0x2000>; ==== //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/de4led/terasic_de4led_fdt.c#3 (text+ko) ==== @@ -62,7 +62,7 @@ terasic_de4led_fdt_probe(device_t dev) { - if (ofw_bus_is_compatible(dev, "cambridge,de4led")) { + if (ofw_bus_is_compatible(dev, "sri-cambridge,de4led")) { device_set_desc(dev, "Terasic DE4 8-element LED"); return (BUS_PROBE_DEFAULT); } ==== //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/mtl/terasic_mtl_fdt.c#3 (text+ko) ==== @@ -59,7 +59,7 @@ terasic_mtl_fdt_probe(device_t dev) { - if (ofw_bus_is_compatible(dev, "cambridge,mtl")) { + if (ofw_bus_is_compatible(dev, "sri-cambridge,mtl")) { device_set_desc(dev, "Terasic Multi-touch LCD (MTL)"); return (BUS_PROBE_DEFAULT); } From owner-p4-projects@FreeBSD.ORG Thu Jan 3 16:31:50 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 17C49EB5; Thu, 3 Jan 2013 16:31:50 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C3D12EB3 for ; Thu, 3 Jan 2013 16:31:49 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id A75D3260 for ; Thu, 3 Jan 2013 16:31:49 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r03GVnm6058797 for ; Thu, 3 Jan 2013 16:31:49 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r03GVmMG058794 for perforce@freebsd.org; Thu, 3 Jan 2013 16:31:48 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Thu, 3 Jan 2013 16:31:48 GMT Message-Id: <201301031631.r03GVmMG058794@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219945 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2013 16:31:50 -0000 http://p4web.freebsd.org/@@219945?ac=10 Change 219945 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/03 16:31:30 Copy DE-4 BERI FDT configuration as a starting point for a similar tPad configuration. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-tpad.dts#1 branch Differences ... From owner-p4-projects@FreeBSD.ORG Thu Jan 3 16:44:03 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E820C53C; Thu, 3 Jan 2013 16:44:02 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9FDDD53A for ; Thu, 3 Jan 2013 16:44:02 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 774A52ED for ; Thu, 3 Jan 2013 16:44:02 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r03Gi2FC059238 for ; Thu, 3 Jan 2013 16:44:02 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r03Gi2QZ059235 for perforce@freebsd.org; Thu, 3 Jan 2013 16:44:02 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Thu, 3 Jan 2013 16:44:02 GMT Message-Id: <201301031644.r03Gi2QZ059235@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219946 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2013 16:44:03 -0000 http://p4web.freebsd.org/@@219946?ac=10 Change 219946 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/03 16:43:49 Populate a template FDT description of the Terasic tPad as configured for BERI. The touch screen DMA buffer and FIFO are in the middle of DRAM, so for now expose only 64M rather than 128M to FreeBSD, until we've sorted out how to handle reserved memory regions with FDT. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-tpad.dts#2 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-tpad.dts#2 (text+ko) ==== @@ -64,9 +64,32 @@ compatible = "simple-bus", "mips4k,cp0"; ranges = <>; + /* + * XXXRW: Should mark the video display frame buffer as + * reserved! Until then, mark 64M as available DRAM rather + * than 128M. + */ memory { device_type = "memory"; - reg = <0x0 0x40000000>; // 1G at 0x0 + reg = <0x0 0x4000000>; // 64M at 0x0 + }; + + display@4000000 { + compatible = "sri-cambridge,avgen"; + reg = <0x4000000 0x1000000>; + sri-cambridge,width = <2>; + sri-cambridge,fileio = "rw"; + sri-cambridge,mmapio = "rw"; + sri-cambridge,devname = "display"; + }; + + display@5000000 { + compatible = "sri-cambridge,avgen"; + reg = <0x5000000 0x20>; + sri-cambridge,width = <4>; + sri-cambridge,fileio = "rw"; + sri-cambridge,mmapio = "rw"; + sri-cambridge,devname = "touch"; }; serial@7f000000 { @@ -100,31 +123,6 @@ reg = <0x7f007000 0x540>; }; - touchscreen@70400000 { - compatible = "sri-cambridge,mtl"; - reg = <0x70400000 0x1000 - 0x70000000 0x177000 - 0x70177000 0x2000>; - }; - - flash@0x74000000 { - compatible = "intel,strataflash"; - reg = <0x74000000 0x2000000>; - }; - - flash@0x76000000 { - compatible = "intel,strataflash"; - reg = <0x76000000 0x2000000>; - }; - - avgen@0x7f009000 { - compatible = "sri-cambridge,avgen"; - reg = <0x7f009000 0x2>; - sri-cambridge,width = <1>; - sri-cambridge,fileio = "r"; - sri-cambridge,devname = "de4bsw"; - }; - avgen@0x7f00a000 { compatible = "sri-cambridge,avgen"; reg = <0x7f00a000 0x14>; From owner-p4-projects@FreeBSD.ORG Fri Jan 4 09:10:21 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 86150DB; Fri, 4 Jan 2013 09:10:21 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3D805D9 for ; Fri, 4 Jan 2013 09:10:21 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 2ADAD789 for ; Fri, 4 Jan 2013 09:10:21 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r049AKmv099559 for ; Fri, 4 Jan 2013 09:10:20 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r049AK1p099556 for perforce@freebsd.org; Fri, 4 Jan 2013 09:10:20 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Fri, 4 Jan 2013 09:10:20 GMT Message-Id: <201301040910.r049AK1p099556@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219948 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 09:10:21 -0000 http://p4web.freebsd.org/@@219948?ac=10 Change 219948 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/04 09:09:35 Add code so that the BERI boot process can ask the kernel linker for DTB blobs that may have been left for it by the boot loader, as done on PowerPC and ARM. This will require both a more mature boot loader, and more mature boot loader argument passing mechanism, than currently supported on BERI. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/mips/beri/beri_machdep.c#8 edit .. //depot/projects/ctsrd/beribsd/src/sys/mips/include/metadata.h#2 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/mips/beri/beri_machdep.c#8 (text+ko) ==== @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -70,6 +71,7 @@ #include #include #include +#include #include #include @@ -135,6 +137,10 @@ char **argv = (char **)a1; char **envp = (char **)a2; unsigned int memsize = a3; +#ifdef FDT + vm_offset_t dtbp; + void *kmdp; +#endif int i; /* clear the BSS and SBSS segments */ @@ -146,8 +152,24 @@ mips_pcpu0_init(); #ifdef FDT -#ifndef FDT_DTB_STATIC -#error "mips_init with FDT requires FDT_DTB_STATIC" + /* + * Find the dtb passed in by the boot loader (currently fictional). + */ + kmdp = preload_search_by_type("elf kernel"); + if (kmdp != NULL) + dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); + else + dtbp = (vm_offset_t)NULL; + +#if defined(FDT_DTB_STATIC) + /* + * In case the device tree blob was not retrieved (from metadata) try + * to use the statically embedded one. + */ + if (dtbp == (vm_offset_t)NULL) + dtbp = (vm_offset_t)&fdt_static_dtb; +#else +#error "Non-static FDT not yet supported on BERI" #endif if (OF_install(OFW_FDT, 0) == FALSE) ==== //depot/projects/ctsrd/beribsd/src/sys/mips/include/metadata.h#2 (text+ko) ==== @@ -30,5 +30,6 @@ #define _MACHINE_METADATA_H_ #define MODINFOMD_SMAP 0x1001 +#define MODINFOMD_DTBP 0x1002 #endif /* !_MACHINE_METADATA_H_ */ From owner-p4-projects@FreeBSD.ORG Fri Jan 4 09:53:06 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E2BCACC7; Fri, 4 Jan 2013 09:53:05 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A0CC7CC5 for ; Fri, 4 Jan 2013 09:53:05 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 90AD3901 for ; Fri, 4 Jan 2013 09:53:05 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r049r40g001657 for ; Fri, 4 Jan 2013 09:53:04 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r049r4Vq001654 for perforce@freebsd.org; Fri, 4 Jan 2013 09:53:04 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Fri, 4 Jan 2013 09:53:04 GMT Message-Id: <201301040953.r049r4Vq001654@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219949 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 09:53:06 -0000 http://p4web.freebsd.org/@@219949?ac=10 Change 219949 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/04 09:52:12 Copy BERI DE4 FDT configuration as a starting point for a BERI simulation target, to replace its corresponding device.hints. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beri-sim.dts#1 branch Differences ... From owner-p4-projects@FreeBSD.ORG Fri Jan 4 09:58:11 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1953AF9E; Fri, 4 Jan 2013 09:58:11 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C5811F9C for ; Fri, 4 Jan 2013 09:58:10 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 90706958 for ; Fri, 4 Jan 2013 09:58:10 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r049wAII001766 for ; Fri, 4 Jan 2013 09:58:10 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r049wAP1001763 for perforce@freebsd.org; Fri, 4 Jan 2013 09:58:10 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Fri, 4 Jan 2013 09:58:10 GMT Message-Id: <201301040958.r049wAP1001763@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219950 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 09:58:11 -0000 http://p4web.freebsd.org/@@219950?ac=10 Change 219950 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/04 09:57:15 Provide a BERI simulation FDT configuration. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beri-sim.dts#2 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beri-sim.dts#2 (text+ko) ==== @@ -41,8 +41,8 @@ */ / { - model = "SRI/Cambridge BeriPad (DE4)"; - compatible = "sri-cambridge,beripad-de4"; + model = "SRI/Cambridge BERI simulation"; + compatible = "sri-cambridge,beri-sim"; #address-cells = <1>; #size-cells = <1>; @@ -66,7 +66,7 @@ memory { device_type = "memory"; - reg = <0x0 0x40000000>; // 1G at 0x0 + reg = <0x0 0x4000000>; // 64M at 0x0 }; serial@7f000000 { @@ -90,41 +90,6 @@ reg = <0x7f008000 0x400>; }; - led@7f006000 { - compatible = "sri-cambridge,de4led"; - reg = <0x7f006000 0x1>; - }; - - ethernet@7f007000 { - compatible = "altera,atse"; - reg = <0x7f007000 0x540>; - }; - - touchscreen@70400000 { - compatible = "sri-cambridge,mtl"; - reg = <0x70400000 0x1000 - 0x70000000 0x177000 - 0x70177000 0x2000>; - }; - - flash@0x74000000 { - compatible = "intel,strataflash"; - reg = <0x74000000 0x2000000>; - }; - - flash@0x76000000 { - compatible = "intel,strataflash"; - reg = <0x76000000 0x2000000>; - }; - - avgen@0x7f009000 { - compatible = "sri-cambridge,avgen"; - reg = <0x7f009000 0x2>; - sri-cambridge,width = <1>; - sri-cambridge,fileio = "r"; - sri-cambridge,devname = "de4bsw"; - }; - avgen@0x7f00a000 { compatible = "sri-cambridge,avgen"; reg = <0x7f00a000 0x14>; From owner-p4-projects@FreeBSD.ORG Fri Jan 4 10:28:43 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 016D3705; Fri, 4 Jan 2013 10:28:43 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B112E703 for ; Fri, 4 Jan 2013 10:28:42 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 947A6A83 for ; Fri, 4 Jan 2013 10:28:42 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r04ASgGQ003929 for ; Fri, 4 Jan 2013 10:28:42 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r04ASgZR003926 for perforce@freebsd.org; Fri, 4 Jan 2013 10:28:42 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Fri, 4 Jan 2013 10:28:42 GMT Message-Id: <201301041028.r04ASgZR003926@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219951 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 10:28:43 -0000 http://p4web.freebsd.org/@@219951?ac=10 Change 219951 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/04 10:28:34 Use just FDT to configure the FreeBSD/beri simulation target. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_SIM.hints#3 delete .. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_SIM_MDROOT#6 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_SIM_MDROOT#6 (text+ko) ==== @@ -9,7 +9,9 @@ ident BERI_SIM_MDROOT -hints "BERI_SIM.hints" #Default places to look for devices. +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=beri-sim.dts # # This kernel configuration uses an embedded 8MB memory root file system.