From patchwork Thu Aug 16 18:22:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Hubig X-Patchwork-Id: 178065 X-Patchwork-Delegate: andreas.biessmann@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 087932C0093 for ; Fri, 17 Aug 2012 04:22:49 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3BA0B28244; Thu, 16 Aug 2012 20:22:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lmR5zKHKzdGZ; Thu, 16 Aug 2012 20:22:40 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3642028249; Thu, 16 Aug 2012 20:22:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6AC7328234 for ; Thu, 16 Aug 2012 20:22:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Evl7me4pmuTA for ; Thu, 16 Aug 2012 20:22:23 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-bk0-f44.google.com (mail-bk0-f44.google.com [209.85.214.44]) by theia.denx.de (Postfix) with ESMTPS id D622A28238 for ; Thu, 16 Aug 2012 20:22:22 +0200 (CEST) Received: by mail-bk0-f44.google.com with SMTP id y7so1097658bkt.3 for ; Thu, 16 Aug 2012 11:22:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=imko.de; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=oUxEYG0cSVaY4uAMoj/vN2CorkgDykPRjGEAOsD6Pfg=; b=enJANx2NSz5IcRJpv4FbAF6B+iV5CCnefposM6MXz3gPQuvJeGcbtSFw4b5SjOCiJn FFNGzE7xlxU7e0WRWrhIOqd8gMapPh3QjV1hvTD/Y5GM8TiuZwY1QwaUeDp/zL6XaUU+ ix5sUB4FjJ04qlx5oW6kMpx8cvHeX4ae25UXY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=oUxEYG0cSVaY4uAMoj/vN2CorkgDykPRjGEAOsD6Pfg=; b=iM96D8B0zZUE1gg/aB8nf5tvUDtAqfTbMH5LjvSCrlj+DZgsb0w1RWEJk4OuSH4M5N fIZ5gkUAw6MrM3DKWx4sKaEjY5EFkPcCWE7kwWcOhvIo6ZtU9d1OxmB4dJZ/m88OX3mT AhCnOfLtUpCjBDcMlnl+dNUIseE+kYUjHkYvu7WVeecmlqH5ihWgn8oS9K4vJC9XOK7q AaX3adqfTjKzniEhyEDpVApsYOlqztpV2vzivnNUls1C34opMM4l0NGVzRJVDwGF6FHB dyzgU3XF3crP+VHFjrUmVxtAT0qTX9qAVzxwOgCJBpVTrZ4MJgmMhbffxsy4dOpbbKF4 ISmg== Received: by 10.205.136.3 with SMTP id ii3mr1016654bkc.101.1345141342452; Thu, 16 Aug 2012 11:22:22 -0700 (PDT) Received: from localhost.localdomain (business-092-079-181-094.static.arcor-ip.net. [92.79.181.94]) by mx.google.com with ESMTPS id hg13sm2717565bkc.7.2012.08.16.11.22.20 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 16 Aug 2012 11:22:21 -0700 (PDT) From: Markus Hubig To: u-boot@lists.denx.de Date: Thu, 16 Aug 2012 20:22:09 +0200 Message-Id: <1345141329-1084-3-git-send-email-mhubig@imko.de> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1345141329-1084-1-git-send-email-mhubig@imko.de> References: <1345141329-1084-1-git-send-email-mhubig@imko.de> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmFNW3BSx+6YmC2yw+hkbtSIbjbjHoLTtYajAZ9jUnYVyBehUQYi1JSszyIHIL6HWVI6ON9 Subject: [U-Boot] [PATCH 2/2] Fixes the crippled console output on PortuxG20. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de In order to use the serial interface on the PortuxG20 we need to enable the level converter first by setting the PC9 pin to high. The level converter needs some time to settle so we have to use the mdelay() function to wait for some time. Unfortunately we have no timers available at board_early_init_f() so we enable the serial output early within board_postclk_init(). Now the U-Boot output looks fine: | U-Boot 2012.07-00132-gaf1a3b0-dirty (Aug 16 2012 - 18:21:32) | | CPU: AT91SAM9G20 | Crystal frequency: 18.432 MHz | CPU clock : 396.288 MHz | Master clock : 132.096 MHz | DRAM: 64 MiB | WARNING: Caches not enabled | NAND: 128 MiB | In: serial | Out: serial | Err: serial | Net: macb0 | Hit any key to stop autoboot: 0 Signed-off-by: Markus Hubig Cc: Andreas Bießmann --- board/taskit/stamp9g20/stamp9g20.c | 21 +++++++++++++++++---- include/configs/stamp9g20.h | 1 + 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/board/taskit/stamp9g20/stamp9g20.c b/board/taskit/stamp9g20/stamp9g20.c index 5e07bf8..06df0af 100644 --- a/board/taskit/stamp9g20/stamp9g20.c +++ b/board/taskit/stamp9g20/stamp9g20.c @@ -159,15 +159,28 @@ int board_early_init_f(void) return 0; } -int board_init(void) +int board_postclk_init(void) { - /* Adress of boot parameters */ - gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; + /* + * Initialize the serial interface here, because be need a running + * timer to set PC9 to high and wait for some time to enable the + * level converter of the RS232 interface on the PortuxG20 board. + */ - /* Enable the serial interface */ +#ifdef CONFIG_PORTUXG20 at91_set_gpio_output(AT91_PIN_PC9, 1); + mdelay(1); +#endif at91_seriald_hw_init(); + return 0; +} + +int board_init(void) +{ + /* Adress of boot parameters */ + gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; + stamp9G20_nand_hw_init(); #ifdef CONFIG_MACB stamp9G20_macb_hw_init(); diff --git a/include/configs/stamp9g20.h b/include/configs/stamp9g20.h index a2a0156..a881eef 100644 --- a/include/configs/stamp9g20.h +++ b/include/configs/stamp9g20.h @@ -59,6 +59,7 @@ #define CONFIG_INITRD_TAG /* pass initrd param to kernel */ #define CONFIG_SKIP_LOWLEVEL_INIT /* U-Boot is loaded by a bootloader */ #define CONFIG_BOARD_EARLY_INIT_f /* call board_early_init_f() */ +#define CONFIG_BOARD_POSTCLK_INIT /* call board_postclk_init() */ #define CONFIG_DISPLAY_CPUINFO /* display CPU Info at startup */ /* setting board specific options */