From owner-svn-src-all@FreeBSD.ORG Wed Jan 16 01:22:28 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 270F4E0F; Wed, 16 Jan 2013 01:22:28 +0000 (UTC) (envelope-from ganbold@gmail.com) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by mx1.freebsd.org (Postfix) with ESMTP id C2B39B5B; Wed, 16 Jan 2013 01:22:27 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so1471665ieb.39 for ; Tue, 15 Jan 2013 17:22:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ZQsGLsbaJMPl0tl+aFHYTmH2oeH8wzeM6XqHYVTAtro=; b=YALYiorRwVnxws/zY9dqCAkOEkmwTQI58fCwy2D9t7Wfs6zjT4606bqNZYIEjbuIzj T09RD33qqOu+PEH/tz9ucqZsH4lyBSBPI2nQK0NJdthYuoa1VLsGjIoyBZcnRiv5ND1T ilfZ7gLbvNFDbtQa+0PkuZ1Ti+WjO5EZDZ7ltZavdjhK6xQAyEnUvqxVvmOBkAEYT+Tg nu1H0Z/hbjTdacKbuDtArVBg+LtM62u5PnH1ijZIPAGxiFDYZw0tWj+fiQ8hjB3dDzcI MoBYEwkpuqFPFIDdywJcqeDUceKsr5x0auDsqm0Kyy00NXlzYVUex+GPoat6BC0j2IOS 2Q6A== MIME-Version: 1.0 Received: by 10.43.114.4 with SMTP id ey4mr94747icc.27.1358299347026; Tue, 15 Jan 2013 17:22:27 -0800 (PST) Received: by 10.64.170.167 with HTTP; Tue, 15 Jan 2013 17:22:26 -0800 (PST) In-Reply-To: <20130115162116.GI20538@FreeBSD.org> References: <201301150826.r0F8QGJr044600@svn.freebsd.org> <20130115162116.GI20538@FreeBSD.org> Date: Wed, 16 Jan 2013 09:22:26 +0800 Message-ID: Subject: Re: svn commit: r245450 - in head/sys: arm/allwinner arm/conf boot/fdt/dts From: Ganbold Tsagaankhuu To: "Wojciech A. Koszek" Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, Ganbold Tsagaankhuu , 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: Wed, 16 Jan 2013 01:22:28 -0000 On Wed, Jan 16, 2013 at 12:21 AM, Wojciech A. Koszek wrote: > 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? This is just initial support of the SoC so eventually I hope it will be improved. sorry for the noise and thanks for the comments, Ganbold > >> +# >> +# >> +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/