From patchwork Tue Aug 18 13:53:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 508322 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 84C81140293 for ; Tue, 18 Aug 2015 23:54:09 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2507A4B768; Tue, 18 Aug 2015 15:54:05 +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 op0a_mmTo9NV; Tue, 18 Aug 2015 15:54:04 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 68AAF4B754; Tue, 18 Aug 2015 15:54:04 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 534E24B754 for ; Tue, 18 Aug 2015 15:54:02 +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 FdigJ3oyLIdD for ; Tue, 18 Aug 2015 15:54:02 +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 pollux.denx.de (host-82-135-33-74.customer.m-online.net [82.135.33.74]) by theia.denx.de (Postfix) with ESMTP id 101B14B752 for ; Tue, 18 Aug 2015 15:53:58 +0200 (CEST) Received: by pollux.denx.de (Postfix, from userid 515) id 32504A72F; Tue, 18 Aug 2015 15:53:58 +0200 (CEST) From: Heiko Schocher To: U-Boot Mailing List Date: Tue, 18 Aug 2015 15:53:56 +0200 Message-Id: <1439906036-18247-1-git-send-email-hs@denx.de> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 Subject: [U-Boot] [PATCH v2] corvus, dfu: add dfu support 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" add support for DFU on the corvus board. Signed-off-by: Heiko Schocher --- Changes in v2: - rebase to 0d339cf9a969f0c249713d3697e735184f1bd955 - fix changes introduced through commit: 01acd6abbdd5: usb: USB download gadget and functions config options coherent naming board/siemens/corvus/board.c | 21 +++++++++++++++++++++ include/configs/corvus.h | 29 +++++++++++++++++++++++++++-- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/board/siemens/corvus/board.c b/board/siemens/corvus/board.c index f3f6dae..426d0cd 100644 --- a/board/siemens/corvus/board.c +++ b/board/siemens/corvus/board.c @@ -29,6 +29,10 @@ #include #include +#ifdef CONFIG_USB_GADGET_ATMEL_USBA +#include +#endif + DECLARE_GLOBAL_DATA_PTR; static void corvus_nand_hw_init(void) @@ -210,6 +214,19 @@ int board_early_init_f(void) return 0; } +#ifdef CONFIG_USB_GADGET_ATMEL_USBA +/* from ./arch/arm/mach-at91/armv7/sama5d3_devices.c */ +void at91_udp_hw_init(void) +{ + struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; + + /* Enable UPLL clock */ + writel(AT91_PMC_UPLLEN | AT91_PMC_BIASEN, &pmc->uckr); + /* Enable UDPHS clock */ + at91_periph_clk_enable(ATMEL_ID_UDPHS); +} +#endif + int board_init(void) { /* address of boot parameters */ @@ -230,6 +247,10 @@ int board_init(void) #ifdef CONFIG_CMD_USB taurus_usb_hw_init(); #endif +#ifdef CONFIG_USB_GADGET_ATMEL_USBA + at91_udp_hw_init(); + usba_udc_probe(&pdata); +#endif return 0; } diff --git a/include/configs/corvus.h b/include/configs/corvus.h index 2d2f3c1..2bad20f 100644 --- a/include/configs/corvus.h +++ b/include/configs/corvus.h @@ -113,7 +113,32 @@ #define CONFIG_DOS_PARTITION #define CONFIG_USB_STORAGE -#define CONFIG_SYS_LOAD_ADDR 0x72000000 /* load address */ +/* USB DFU support */ +#define CONFIG_CMD_MTDPARTS +#define CONFIG_MTD_DEVICE +#define CONFIG_MTD_PARTITIONS + +#define CONFIG_USB_GADGET +#define CONFIG_USB_GADGET_DUALSPEED +#define CONFIG_USB_GADGET_ATMEL_USBA + +/* DFU class support */ +#define CONFIG_CMD_DFU +#define CONFIG_USB_FUNCTION_DFU +#define CONFIG_DFU_NAND +#define CONFIG_USB_GADGET_DOWNLOAD +#define CONFIG_USB_GADGET_VBUS_DRAW 2 +#define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 << 20) +#define DFU_MANIFEST_POLL_TIMEOUT 25000 + +/* USB DFU IDs */ +#define CONFIG_G_DNL_VENDOR_NUM 0x0908 +#define CONFIG_G_DNL_PRODUCT_NUM 0x02d2 +#define CONFIG_G_DNL_MANUFACTURER "Siemens AG" + +#define CONFIG_SYS_CACHELINE_SIZE 0x2000 +/* fuer was das ? */ +#define CONFIG_SYS_LOAD_ADDR ATMEL_BASE_CS6 /* bootstrap + u-boot + env in nandflash */ #define CONFIG_ENV_IS_IN_NAND @@ -146,7 +171,7 @@ * Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN ROUND(3 * CONFIG_ENV_SIZE + \ - 128*1024, 0x1000) + 4*1024*1024, 0x1000) /* Defines for SPL */ #define CONFIG_SPL_FRAMEWORK #define CONFIG_SPL_TEXT_BASE 0x300000