From patchwork Mon Feb 25 16:44:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 15069 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id E234923E02 for ; Mon, 25 Feb 2013 16:44:42 +0000 (UTC) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by fiordland.canonical.com (Postfix) with ESMTP id 9254FA180C2 for ; Mon, 25 Feb 2013 16:44:42 +0000 (UTC) Received: by mail-vc0-f169.google.com with SMTP id n10so1804639vcn.14 for ; Mon, 25 Feb 2013 08:44:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=81U68tPKBU0sCEsuW2ojuIZRo55WvLjQd4dEr01d1uo=; b=Oy3o10FNs4MeXuu2xhEqRG56o6/LULu2Azb7bPeaLituhqstT2IzjpQadwUhBoM4/P iONM5Q0HT1drFj8WFDV0RzQI4A7b/HR9ojINoJGrg/WH89eYAE1AfsbhYxvCvQJZ/4Zy lgWLGwZNiTgmJxXskSYoWKL1QKPlIxl8uKxPe5e5AQ66MtvLfNZB7a6zJ33eyF68hAAH PyHzfvi2t7CgdQ9wP+1APulfM9AjHmDbDpc83xaxzjhMPh0FqYnqZEpf8iPPvQxt6TE+ N+DAwjDlLP+NQltcjDgvUXAnPzLw2rjegb0RqwxhgjlqfllR1+osonaWJ9mKvxcaL03u aImA== X-Received: by 10.52.29.18 with SMTP id f18mr8833616vdh.57.1361810682055; Mon, 25 Feb 2013 08:44:42 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp67552veb; Mon, 25 Feb 2013 08:44:41 -0800 (PST) X-Received: by 10.204.13.28 with SMTP id z28mr5364534bkz.83.1361810676954; Mon, 25 Feb 2013 08:44:36 -0800 (PST) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id fy7si3766999bkc.212.2013.02.25.08.44.36 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 25 Feb 2013 08:44:36 -0800 (PST) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Authentication-Results: mx.google.com; spf=neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1UA1AH-0006tk-Ii; Mon, 25 Feb 2013 16:44:33 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= , Anthony Liguori Subject: [PATCH v2 10/10] hw/vexpress: Set reset values for daughterboard oscillators Date: Mon, 25 Feb 2013 16:44:33 +0000 Message-Id: <1361810673-26473-11-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1361810673-26473-1-git-send-email-peter.maydell@linaro.org> References: <1361810673-26473-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQnM5mflKqyiZiRdNF1ucdBXfiRS1w/zOjIglVi7t7TnToStTbSTLlX01NGXCthb+a4PguQN Set the reset values for the VExpress daughterboard oscillators via the new sysctl properties. Signed-off-by: Peter Maydell --- hw/vexpress.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/hw/vexpress.c b/hw/vexpress.c index 8653200..547379a 100644 --- a/hw/vexpress.c +++ b/hw/vexpress.c @@ -156,6 +156,8 @@ struct VEDBoardInfo { uint32_t proc_id; uint32_t num_voltage_sensors; const uint32_t *voltages; + uint32_t num_clocks; + const uint32_t *clocks; DBoardInitFn *init; }; @@ -260,6 +262,13 @@ static const uint32_t a9_voltages[] = { 3300000, /* VCC3V3 : 3.3V : local board supply for misc external logic */ }; +/* Reset values for daughterboard oscillators (in Hz) */ +static const uint32_t a9_clocks[] = { + 45000000, /* AMBA AXI ACLK: 45MHz */ + 23750000, /* daughterboard CLCD clock: 23.75MHz */ + 66670000, /* Test chip reference clock: 66.67MHz */ +}; + static const VEDBoardInfo a9_daughterboard = { .motherboard_map = motherboard_legacy_map, .loader_start = 0x60000000, @@ -267,6 +276,8 @@ static const VEDBoardInfo a9_daughterboard = { .proc_id = 0x0c000191, .num_voltage_sensors = ARRAY_SIZE(a9_voltages), .voltages = a9_voltages, + .num_clocks = ARRAY_SIZE(a9_clocks), + .clocks = a9_clocks, .init = a9_daughterboard_init, }; @@ -358,6 +369,18 @@ static const uint32_t a15_voltages[] = { 900000, /* Vcore: 0.9V : CPU core voltage */ }; +static const uint32_t a15_clocks[] = { + 60000000, /* OSCCLK0: 60MHz : CPU_CLK reference */ + 0, /* OSCCLK1: reserved */ + 0, /* OSCCLK2: reserved */ + 0, /* OSCCLK3: reserved */ + 40000000, /* OSCCLK4: 40MHz : external AXI master clock */ + 23750000, /* OSCCLK5: 23.75MHz : HDLCD PLL reference */ + 50000000, /* OSCCLK6: 50MHz : static memory controller clock */ + 60000000, /* OSCCLK7: 60MHz : SYSCLK reference */ + 40000000, /* OSCCLK8: 40MHz : DDR2 PLL reference */ +}; + static const VEDBoardInfo a15_daughterboard = { .motherboard_map = motherboard_aseries_map, .loader_start = 0x80000000, @@ -365,6 +388,8 @@ static const VEDBoardInfo a15_daughterboard = { .proc_id = 0x14000237, .num_voltage_sensors = ARRAY_SIZE(a15_voltages), .voltages = a15_voltages, + .num_clocks = ARRAY_SIZE(a15_clocks), + .clocks = a15_clocks, .init = a15_daughterboard_init, }; @@ -400,6 +425,13 @@ static void vexpress_common_init(const VEDBoardInfo *daughterboard, qdev_prop_set_uint32(sysctl, propname, daughterboard->voltages[i]); g_free(propname); } + qdev_prop_set_uint32(sysctl, "len-db-clock", + daughterboard->num_clocks); + for (i = 0; i < daughterboard->num_clocks; i++) { + char *propname = g_strdup_printf("db-clock[%d]", i); + qdev_prop_set_uint32(sysctl, propname, daughterboard->clocks[i]); + g_free(propname); + } qdev_init_nofail(sysctl); sysbus_mmio_map(SYS_BUS_DEVICE(sysctl), 0, map[VE_SYSREGS]);