From patchwork Sat Sep 5 13:45:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 514822 X-Patchwork-Delegate: trini@ti.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 3ACC01401DE for ; Sat, 5 Sep 2015 23:45:32 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=QcKeer6C; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 940C84B713; Sat, 5 Sep 2015 15:45:28 +0200 (CEST) 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 50MTZQozY74A; Sat, 5 Sep 2015 15:45:28 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DB9584B6FA; Sat, 5 Sep 2015 15:45:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9DA384B6FA for ; Sat, 5 Sep 2015 15:45:25 +0200 (CEST) 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 Va7-zfXdu6KN for ; Sat, 5 Sep 2015 15:45:25 +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-io0-f172.google.com (mail-io0-f172.google.com [209.85.223.172]) by theia.denx.de (Postfix) with ESMTPS id 3577F4B6F6 for ; Sat, 5 Sep 2015 15:45:22 +0200 (CEST) Received: by ioii196 with SMTP id i196so50694513ioi.3 for ; Sat, 05 Sep 2015 06:45:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=XGfIF+kQ078q2msoeA5yUiUqWZTNXADwdmX/ngXW6bU=; b=QcKeer6Cl2Nb10HFlFUa0FQSuLKEDpGnqR/EpEWodNn+6C5k+xwlDQtO2aQc0PuilK 4ZyeKm2Ju+NyLSbCO+dzijawWq+NpAXYlr32uWMHaxXEUgt0Mfyod+UqcLDTj+f+MGB4 UjLA4VUruo/ccsLLkmJ9SZyrSNlPgWYksqmgRvr5UD1gp8KSF6vWPxMDml9FLoKcgDU8 SnWlwLuAlidVNJwbS6KPGMVit4ug+ECRun01CRA5yWyYneGnfzrJ9XM02ABCmQH19dqO +tltvwRpr3+OKRXMEhAmB4KqDRAxH7EnWpfadrKwabLR9d0AGCadxkVdD3yBDEqXeLPr PkWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=XGfIF+kQ078q2msoeA5yUiUqWZTNXADwdmX/ngXW6bU=; b=HmX95FEe/ngFy001k8XxNjl51KMJoIZArU7dqF0WGRZ1F7z+hwwJgW+BQP/kuf6WMl fF3Hvb1zipiSbM/NjE0m5TGOPoKqPYKf5u9+T6TI1RCPA8gdeQ5lhPDsLdTKdBbVII8f xSJ4HCKR82y5sNv036+IUvCPQyMCOKHGirWFn2/yzv4/uutGrMPp7yfjYpvc/MZKE8W7 Bw3ZolJZWkCOfNBrbC8B44+SkzEFVy/SkHD6DXpUUXh96Iqftu8yg1RfKr4Yf0le0LNB 8/qZ22KTiCHxVHjJXp08Q8TNBf+6Vf6uuKjkbDTTOP5VPh5qNeL8YTrq+CmkYfujDk4U J2aA== X-Gm-Message-State: ALoCoQmlwyHVsprAQstUDsxa/2OO7M7tosNFd2DPZ8LzHTcg18j1wysryoc7/5c8JfhSsFab3OG4 X-Received: by 10.107.133.75 with SMTP id h72mr16470958iod.1.1441460720473; Sat, 05 Sep 2015 06:45:20 -0700 (PDT) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by smtp.gmail.com with ESMTPSA id n8sm3538406igv.22.2015.09.05.06.45.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Sep 2015 06:45:19 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id BD54A220926; Sat, 5 Sep 2015 07:45:18 -0600 (MDT) From: Simon Glass To: Tom Rini Date: Sat, 5 Sep 2015 07:45:17 -0600 Message-Id: <1441460717-23318-1-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.5.0.457.gab17608 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH] RFC: dm: Add proposed timeline and guide for porting serial drivers X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add a README with a brief guide to porting serial drivers over to use driver model. Add a timeline also. Signed-off-by: Simon Glass --- I intend to cc the final patch to all U-Boot maintainers using something like this: (for f in $(find . -name MAINTAINERS); do grep ^M: $f; done) | \ awk '{$1=""; print "Series-cc:" $0}' |sort | uniq This is about 229 email address, of which 217 seem to be different people. doc/driver-model/serial-howto.txt | 58 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 doc/driver-model/serial-howto.txt diff --git a/doc/driver-model/serial-howto.txt b/doc/driver-model/serial-howto.txt new file mode 100644 index 0000000..76a75da --- /dev/null +++ b/doc/driver-model/serial-howto.txt @@ -0,0 +1,58 @@ +How to port a serial driver to driver model +=========================================== + +About 16 of 33 serial drivers have been converted as at September 2015. It +is time for maintainers to start converting over the remaining serial drivers: + + altera_jtag_uart.c + altera_uart.c + arm_dcc.c + lpc32xx_hsuart.c + mcfuart.c + mxs_auart.c + opencores_yanu.c + serial_bfin.c + serial_imx.c + serial_lpuart.c + serial_max3100.c + serial_pxa.c + serial_s3c24x0.c + serial_sa1100.c + serial_stm32.c + serial_xuartlite.c + usbtty.c + +You should complete this by Christmas 2015. + +Here is a suggested approach for converting your serial driver over to driver +model. Please feel free to update this file with your ideas and suggestions. + +- #ifdef out all your own serial driver code (#ifndef CONFIG_DM_SERIAL) +- Define CONFIG_DM_SERIAL for your board, vendor or architecture +- If the board does not already use driver model, you need CONFIG_DM also +- Your board should then build, but will not boot since there will be no serial + driver +- Add the U_BOOT_DRIVER piece at the end (e.g. copy serial_s5p.c for example) +- Add a private struct for the driver data - avoid using static variables +- Implement each of the driver methods, perhaps by calling your old methods +- You may need to adjust the function parameters so that the old and new + implementations can share most of the existing code +- If you convert all existing users of the driver, remove the pre-driver-model + code + +In terms of patches a conversion series typically has these patches: +- clean up / prepare the driver for conversion +- add driver model code +- convert at least one existing board to use driver model serial +- (if no boards remain that don't use driver model) remove the old code + +This may be a good time to move your board to use device tree also. Mostly +this involves these steps: + +- define CONFIG_OF_CONTROL and CONFIG_OF_SEPARATE +- add your device tree files to arch//dts +- update the Makefile there +- Add stdout-path to your /chosen device tree node if it is not already there +- build and get u-boot-dtb.bin so you can test it +- Your drivers can now use device tree +- For device tree in SPL, define CONFIG_SPL_OF_CONTROL