Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/175282/?format=api
{ "id": 175282, "url": "http://patchwork.ozlabs.org/api/patches/175282/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/1344239199-11445-5-git-send-email-monstr@monstr.eu/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1344239199-11445-5-git-send-email-monstr@monstr.eu>", "list_archive_url": null, "date": "2012-08-06T07:46:37", "name": "[U-Boot,v2,5/7] microblaze: timer: Prepare for device-tree initialization", "commit_ref": null, "pull_url": null, "state": "deferred", "archived": false, "hash": "a7d1d84b1626161533873f34612cfa40627b87f9", "submitter": { "id": 2237, "url": "http://patchwork.ozlabs.org/api/people/2237/?format=api", "name": "Michal Simek", "email": "monstr@monstr.eu" }, "delegate": { "id": 1714, "url": "http://patchwork.ozlabs.org/api/users/1714/?format=api", "username": "vapier", "first_name": "Mike", "last_name": "Frysinger", "email": "vapier@gentoo.org" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/1344239199-11445-5-git-send-email-monstr@monstr.eu/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/175282/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/175282/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "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])\n\tby ozlabs.org (Postfix) with ESMTP id 245112C0079\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 6 Aug 2012 17:47:47 +1000 (EST)", "from localhost (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id 0F7FC28166;\n\tMon, 6 Aug 2012 09:47:29 +0200 (CEST)", "from theia.denx.de ([127.0.0.1])\n\tby localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id eVOf1evIpame; Mon, 6 Aug 2012 09:47:28 +0200 (CEST)", "from theia.denx.de (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id 8F9CD28167;\n\tMon, 6 Aug 2012 09:47:12 +0200 (CEST)", "from localhost (localhost [127.0.0.1])\n\tby theia.denx.de (Postfix) with ESMTP id 84E7728153\n\tfor <u-boot@lists.denx.de>; Mon, 6 Aug 2012 09:47:08 +0200 (CEST)", "from theia.denx.de ([127.0.0.1])\n\tby localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id BX58hXBu73oX for <u-boot@lists.denx.de>;\n\tMon, 6 Aug 2012 09:47:08 +0200 (CEST)", "from mail-we0-f172.google.com (mail-we0-f172.google.com\n\t[74.125.82.172]) by theia.denx.de (Postfix) with ESMTPS id CB0672812A\n\tfor <u-boot@lists.denx.de>; Mon, 6 Aug 2012 09:47:00 +0200 (CEST)", "by weyu54 with SMTP id u54so1855992wey.3\n\tfor <u-boot@lists.denx.de>; Mon, 06 Aug 2012 00:47:00 -0700 (PDT)", "by 10.216.232.204 with SMTP id n54mr5421480weq.182.1344239220131; \n\tMon, 06 Aug 2012 00:47:00 -0700 (PDT)", "from localhost (nat-2.starnet.cz. [92.62.224.2])\n\tby mx.google.com with ESMTPS id\n\tk20sm14293907wiv.11.2012.08.06.00.46.58\n\t(version=TLSv1/SSLv3 cipher=OTHER);\n\tMon, 06 Aug 2012 00:46:59 -0700 (PDT)" ], "X-Virus-Scanned": [ "Debian amavisd-new at theia.denx.de", "Debian amavisd-new at theia.denx.de" ], "X-policyd-weight": "NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5\n\tNOT_IN_BL_NJABL=-1.5 (only DNSBL check requested)", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=google.com; s=20120113;\n\th=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references\n\t:x-gm-message-state;\n\tbh=2fDmN8uoLVCKMJkT5asqCYUffQoUM3IhCQJgq8EARRs=;\n\tb=IAC0s4YU5lIdcaC6iTuJgZKVbK7V08NRZ+cZ2L8vVrmXVQSXsnHRspD4JiAAWnDjZV\n\tfvtcrf9v5aviduQ+UoXFQlqie3OMPcTz1o6W3mYdDGDzGz3kNb2HQGrwXC0m9uj0NR6M\n\tpRe/dcPp2CtMEtbv9T6uwrpR0pXWQGvuAFXCjANQJuSpQ8iwzGjvrh/w9zPDzLdc5OAD\n\tLLlcD2z9bSTvKRhNwZgfIojrzGZQ9/vMJX1j2AUjzzBN5QZz+TUyOAsm/dIqtaBJnyD2\n\t9w9YZhsWPHqXFL4QopiCfc86rSV/+Ib3hjWqyRy+voKB/xcxrh9ShFHIvK2nR2kN61Co\n\tSOtw==", "From": "Michal Simek <monstr@monstr.eu>", "To": "u-boot@lists.denx.de", "Date": "Mon, 6 Aug 2012 09:46:37 +0200", "Message-Id": "<1344239199-11445-5-git-send-email-monstr@monstr.eu>", "X-Mailer": "git-send-email 1.7.0.4", "In-Reply-To": "<1344239199-11445-1-git-send-email-monstr@monstr.eu>", "References": "<1344239199-11445-1-git-send-email-monstr@monstr.eu>", "X-Gm-Message-State": "ALoCoQniJUj9L1Kncy6g6ImTSUHz00ylXJQyeFVPt1JN+Ex5bX1WFVZRzelYNnq+m4JqqypEvcav", "Cc": "linz@li-pro.net", "Subject": "[U-Boot] [PATCH v2 5/7] microblaze: timer: Prepare for device-tree\n\tinitialization", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.11", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<http://lists.denx.de/mailman/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<http://lists.denx.de/pipermail/u-boot>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<http://lists.denx.de/mailman/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "u-boot-bounces@lists.denx.de", "Errors-To": "u-boot-bounces@lists.denx.de" }, "content": "microblaze: Fix CONFIG_SYS_HZ usage in board config\n\nDo not use hardcoded value. Use CONFIG_SYS_HZ instead.\nSeparate static configuration to single block.\n\nSigned-off-by: Michal Simek <monstr@monstr.eu>\n\n---\nv2: Fix irq type irq == -1 means no IRQ\n---\n arch/microblaze/cpu/timer.c | 69 ++++++++++++-----------\n arch/microblaze/include/asm/microblaze_timer.h | 3 +\n arch/microblaze/lib/board.c | 5 --\n include/configs/microblaze-generic.h | 12 +----\n 4 files changed, 41 insertions(+), 48 deletions(-)", "diff": "diff --git a/arch/microblaze/cpu/timer.c b/arch/microblaze/cpu/timer.c\nindex cc6b897..1330401 100644\n--- a/arch/microblaze/cpu/timer.c\n+++ b/arch/microblaze/cpu/timer.c\n@@ -27,42 +27,30 @@\n #include <asm/microblaze_intc.h>\n \n volatile int timestamp = 0;\n+microblaze_timer_t *tmr;\n \n-#ifdef CONFIG_SYS_TIMER_0\n ulong get_timer (ulong base)\n {\n-\treturn (timestamp - base);\n+\tif (tmr)\n+\t\treturn timestamp - base;\n+\treturn timestamp++ - base;\n }\n-#else\n-ulong get_timer (ulong base)\n-{\n-\treturn (timestamp++ - base);\n-}\n-#endif\n \n-#ifdef CONFIG_SYS_TIMER_0\n void __udelay(unsigned long usec)\n {\n-\tint i;\n+\tu32 i;\n \n-\ti = get_timer(0);\n-\twhile ((get_timer(0) - i) < (usec / 1000))\n-\t\t;\n+\tif (tmr) {\n+\t\ti = get_timer(0);\n+\t\twhile ((get_timer(0) - i) < (usec / 1000))\n+\t\t\t;\n+\t} else {\n+\t\tfor (i = 0; i < (usec * XILINX_CLOCK_FREQ / 10000000); i++)\n+\t\t\t;\n+\t}\n }\n-#else\n-void __udelay(unsigned long usec)\n-{\n-\tunsigned int i;\n \n-\tfor (i = 0; i < (usec * CONFIG_XILINX_CLOCK_FREQ / 10000000); i++)\n-\t\t;\n-}\n-#endif\n-\n-#ifdef CONFIG_SYS_TIMER_0\n-microblaze_timer_t *tmr = (microblaze_timer_t *) (CONFIG_SYS_TIMER_0_ADDR);\n-\n-void timer_isr (void *arg)\n+static void timer_isr(void *arg)\n {\n \ttimestamp++;\n \ttmr->control = tmr->control | TIMER_INTERRUPT;\n@@ -70,15 +58,30 @@ void timer_isr (void *arg)\n \n int timer_init (void)\n {\n-\ttmr->loadreg = CONFIG_SYS_TIMER_0_PRELOAD;\n-\ttmr->control = TIMER_INTERRUPT | TIMER_RESET;\n-\ttmr->control =\n-\t TIMER_ENABLE | TIMER_ENABLE_INTR | TIMER_RELOAD | TIMER_DOWN_COUNT;\n-\ttimestamp = 0;\n-\tinstall_interrupt_handler (CONFIG_SYS_TIMER_0_IRQ, timer_isr, (void *)tmr);\n+\tint irq = -1;\n+\tu32 preload = 0;\n+\tu32 ret = 0;\n+\n+#if defined(CONFIG_SYS_TIMER_0_ADDR) && defined(CONFIG_SYS_INTC_0_NUM)\n+\tpreload = XILINX_CLOCK_FREQ / CONFIG_SYS_HZ;\n+\tirq = CONFIG_SYS_TIMER_0_IRQ;\n+\ttmr = (microblaze_timer_t *) (CONFIG_SYS_TIMER_0_ADDR);\n+#endif\n+\n+\tif (tmr && preload && irq >= 0) {\n+\t\ttmr->loadreg = preload;\n+\t\ttmr->control = TIMER_INTERRUPT | TIMER_RESET;\n+\t\ttmr->control = TIMER_ENABLE | TIMER_ENABLE_INTR |\\\n+\t\t\t\t\tTIMER_RELOAD | TIMER_DOWN_COUNT;\n+\t\ttimestamp = 0;\n+\t\tret = install_interrupt_handler (irq, timer_isr, (void *)tmr);\n+\t\tif (ret)\n+\t\t\ttmr = NULL;\n+\t}\n+\n+\t/* No problem if timer is not found/initialized */\n \treturn 0;\n }\n-#endif\n \n /*\n * This function is derived from PowerPC code (read timebase as long long).\ndiff --git a/arch/microblaze/include/asm/microblaze_timer.h b/arch/microblaze/include/asm/microblaze_timer.h\nindex 844c8db..28e8b02 100644\n--- a/arch/microblaze/include/asm/microblaze_timer.h\n+++ b/arch/microblaze/include/asm/microblaze_timer.h\n@@ -39,3 +39,6 @@ typedef volatile struct microblaze_timer_t {\n \tint loadreg; /* load register TLR */\n \tint counter; /* timer/counter register */\n } microblaze_timer_t;\n+\n+int timer_init(void);\n+\ndiff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c\nindex b5f21d8..fde109f 100644\n--- a/arch/microblaze/lib/board.c\n+++ b/arch/microblaze/lib/board.c\n@@ -42,9 +42,6 @@ DECLARE_GLOBAL_DATA_PTR;\n #ifdef CONFIG_SYS_GPIO_0\n extern int gpio_init (void);\n #endif\n-#ifdef CONFIG_SYS_TIMER_0\n-extern int timer_init (void);\n-#endif\n #ifdef CONFIG_SYS_FSL_2\n extern void fsl_init2 (void);\n #endif\n@@ -74,9 +71,7 @@ init_fnc_t *init_sequence[] = {\n \tgpio_init,\n #endif\n \tinterrupts_init,\n-#ifdef CONFIG_SYS_TIMER_0\n \ttimer_init,\n-#endif\n #ifdef CONFIG_SYS_FSL_2\n \tfsl_init2,\n #endif\ndiff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h\nindex 1266cf7..21ddb2b 100644\n--- a/include/configs/microblaze-generic.h\n+++ b/include/configs/microblaze-generic.h\n@@ -115,19 +115,11 @@\n #endif\n \n /* timer */\n-#ifdef XILINX_TIMER_BASEADDR\n-# if (XILINX_TIMER_IRQ != -1)\n-# define CONFIG_SYS_TIMER_0\t\t1\n+#if defined(XILINX_TIMER_BASEADD) && defined(XILINX_TIMER_IRQ)\n # define CONFIG_SYS_TIMER_0_ADDR\tXILINX_TIMER_BASEADDR\n # define CONFIG_SYS_TIMER_0_IRQ\tXILINX_TIMER_IRQ\n-# define FREQUENCE\tXILINX_CLOCK_FREQ\n-# define CONFIG_SYS_TIMER_0_PRELOAD\t( FREQUENCE/1000 )\n-# endif\n-#elif XILINX_CLOCK_FREQ\n-# define CONFIG_XILINX_CLOCK_FREQ\tXILINX_CLOCK_FREQ\n-#else\n-# error BAD CLOCK FREQ\n #endif\n+\n /* FSL */\n /* #define\tCONFIG_SYS_FSL_2 */\n /* #define\tFSL_INTR_2\t1 */\n", "prefixes": [ "U-Boot", "v2", "5/7" ] }