From owner-svn-src-all@FreeBSD.ORG Tue Jan 15 16:33:38 2013 Return-Path: Delivered-To: svn-src-all@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 3648AD82; Tue, 15 Jan 2013 16:33:38 +0000 (UTC) (envelope-from wkoszek@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [212.87.224.105]) by mx1.freebsd.org (Postfix) with ESMTP id B726C639; Tue, 15 Jan 2013 16:33:37 +0000 (UTC) Received-SPF: pass (freebsd.czest.pl: domain of wkoszek@freebsd.czest.pl designates 212.87.224.105 as permitted sender) receiver=freebsd.czest.pl; client-ip=212.87.224.105; helo=freebsd.czest.pl; envelope-from=wkoszek@freebsd.czest.pl; x-software=spfmilter 0.97 http://www.acme.com/software/spfmilter/ with libspf-unknown; Received: from freebsd.czest.pl (freebsd.czest.pl [212.87.224.105]) by freebsd.czest.pl (8.14.5/8.14.5) with ESMTP id r0FGLGba050848; Tue, 15 Jan 2013 16:21:16 GMT (envelope-from wkoszek@freebsd.czest.pl) Received: (from wkoszek@localhost) by freebsd.czest.pl (8.14.5/8.14.5/Submit) id r0FGLG3W050847; Tue, 15 Jan 2013 16:21:16 GMT (envelope-from wkoszek) Date: Tue, 15 Jan 2013 16:21:16 +0000 From: "Wojciech A. Koszek" To: Ganbold Tsagaankhuu Subject: Re: svn commit: r245450 - in head/sys: arm/allwinner arm/conf boot/fdt/dts Message-ID: <20130115162116.GI20538@FreeBSD.org> References: <201301150826.r0F8QGJr044600@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: <201301150826.r0F8QGJr044600@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on freebsd.czest.pl X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (freebsd.czest.pl [212.87.224.105]); Tue, 15 Jan 2013 16:21:18 +0000 (UTC) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jan 2013 16:33:38 -0000 On Tue, Jan 15, 2013 at 08:26:16AM +0000, Ganbold Tsagaankhuu wrote: > Author: ganbold (doc committer) > Date: Tue Jan 15 08:26:16 2013 > New Revision: 245450 > URL: http://svnweb.freebsd.org/changeset/base/245450 > > Log: > Initial support for Allwinner A10 SoC (Cubieboard) > Add simple console driver > Add interrupt handling and timer codes > Add kernel config file > Add dts file > Approved by: gonzo Ganbold, Thanks for this commit. Comments below. > > Added: head/sys/arm/allwinner/a10_machdep.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/arm/allwinner/a10_machdep.c Tue Jan 15 08:26:16 2013 (r245450) > @@ -0,0 +1,122 @@ > +/*- > + * Copyright (c) 2012 Ganbold Tsagaankhuu. Dot '.' after name isn't necessary. I'd really appreciate having PDF filename of the documentation from which the code was derived in the comments, e.g.: "This file is derived from X.PDF, ver1.0, date 2012/Y/Z" > + * > + * from: FreeBSD: //depot/projects/arm/src/sys/arm/ti/ti_machdep.c > + */ > + [..] > +int > +platform_devmap_init(void) > +{ > + int i = 0; > + > + fdt_devmap[i].pd_va = 0xE1C00000; > + fdt_devmap[i].pd_pa = 0x01C00000; > + fdt_devmap[i].pd_size = 0x00400000; /* 4 MB */ Do you think you could comment on what these mean (or pages in the PDF where can I find them) next to these variables? > > Added: head/sys/arm/allwinner/console.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/arm/allwinner/console.c Tue Jan 15 08:26:16 2013 (r245450) > @@ -0,0 +1,146 @@ [..] > +#ifndef A10_UART_BASE > +#define A10_UART_BASE 0xe1c28000 /* UART0 */ > +#endif > + > +int reg_shift = 2; Could you make it static and move it below defines? > +#define UART_DLL 0 /* Out: Divisor Latch Low */ > +#define UART_DLM 1 /* Out: Divisor Latch High */ > +#define UART_FCR 2 /* Out: FIFO Control Register */ > +#define UART_LCR 3 /* Out: Line Control Register */ > +#define UART_MCR 4 /* Out: Modem Control Register */ > +#define UART_LSR 5 /* In: Line Status Register */ > +#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */ > +#define UART_LSR_DR 0x01 /* Receiver data ready */ > +#define UART_MSR 6 /* In: Modem Status Register */ > +#define UART_SCR 7 /* I/O: Scratch Register */ > + > + > +/* > + * uart related funcs > + */ > +static u_int32_t > +uart_getreg(u_int32_t *bas) > +{ > + return *((volatile u_int32_t *)(bas)) & 0xff; > +} > + > +static void > +uart_setreg(u_int32_t *bas, u_int32_t val) > +{ > + *((volatile u_int32_t *)(bas)) = (u_int32_t)val; > +} > + > +static int > +ub_getc(void) > +{ > + while ((uart_getreg((u_int32_t *)(A10_UART_BASE + > + (UART_LSR << reg_shift))) & UART_LSR_DR) == 0); > + __asm __volatile("nop"); > + > + return (uart_getreg((u_int32_t *)A10_UART_BASE) & 0xff); > +} > + > +static void > +ub_putc(unsigned char c) > +{ > + if (c == '\n') > + ub_putc('\r'); > + > + while ((uart_getreg((u_int32_t *)(A10_UART_BASE + > + (UART_LSR << reg_shift))) & UART_LSR_THRE) == 0) > + __asm __volatile("nop"); > + > + uart_setreg((u_int32_t *)A10_UART_BASE, c); > +} Why aren't bus_* methods used here for accessing memory? > +# > +# > +options PHYSADDR=0x40000000 > + > +makeoptions KERNPHYSADDR=0x40200000 Two tabs? > +options KERNPHYSADDR=0x40200000 > +makeoptions KERNVIRTADDR=0xc0200000 > +options KERNVIRTADDR=0xc0200000 > + > +options STARTUP_PAGETABLE_ADDR=0x48000000 > + > +files "../allwinner/files.a10" > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** -- Wojciech A. Koszek wkoszek@FreeBSD.czest.pl http://FreeBSD.czest.pl/~wkoszek/