diff for duplicates of <54B7F7CD.7030903@free.fr> diff --git a/a/1.txt b/N1/1.txt index b850ba8..c89a080 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -24,3 +24,17 @@ I'm also wondering how cpufreq and cpuidle interact? Is one a subset of the other? Are they orthogonal? Regards. +-------------- next part -------------- +A non-text attachment was scrubbed... +Name: cpufreq.c +Type: text/x-csrc +Size: 2317 bytes +Desc: not available +URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150115/f2c475b8/attachment.bin> +-------------- next part -------------- +A non-text attachment was scrubbed... +Name: temp.h +Type: text/x-chdr +Size: 466 bytes +Desc: not available +URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150115/f2c475b8/attachment-0001.bin> diff --git a/a/2.hdr b/a/2.hdr deleted file mode 100644 index 277eaf1..0000000 --- a/a/2.hdr +++ /dev/null @@ -1,5 +0,0 @@ -Content-Type: text/x-csrc; - name="cpufreq.c" -Content-Transfer-Encoding: 7bit -Content-Disposition: attachment; - filename="cpufreq.c" diff --git a/a/2.txt b/a/2.txt deleted file mode 100644 index 9e8526a..0000000 --- a/a/2.txt +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2014 Sigma Designs - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - */ -#include <linux/module.h> -#include <linux/cpufreq.h> -#include <mach/tango4_gbus.h> /* gbus_read, gbus_write */ -#include "temp.h" - -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Sigma Designs"); -MODULE_DESCRIPTION("cpufreq driver for Tangox 87xx"); - -static struct cpufreq_frequency_table freq_table[] = { - { .driver_data = 1 }, - { .driver_data = 2 }, - { .driver_data = 3 }, - { .driver_data = 9 }, - { .frequency = CPUFREQ_TABLE_END }, -}; - -static unsigned int tangox_get_freq(unsigned int cpu) -{ - union SYS_clkgen_pll pll; - union SYS_clk_div_ctrl div; - - pll.val = gbus_read_reg32(SYS_clkgen0_pll); - if (pll.f.Isel != 1 || pll.f.M != 0) - return 0; - - div.val = gbus_read_reg32(SYS_cpuclk_div_ctrl); - if (div.f.BP != 0 || div.f.F != 0) - return 0; - - return TANGOX_XTAL_FREQ * (pll.f.N + 1) / div.f.I >> pll.f.K; -} - -static int tangox_target(struct cpufreq_policy *policy, unsigned int index) -{ - while (gbus_read_reg32(SYS_cpuclk_div_ctrl) >> 31) - cpu_relax(); - gbus_write_reg32(SYS_cpuclk_div_ctrl, freq_table[index].driver_data); - return 0; -} - -static int tangox_cpu_init(struct cpufreq_policy *policy) -{ - struct cpufreq_frequency_table *p; - unsigned int freq = tangox_get_freq(0); - unsigned int transition_latency_ns = freq / SYS_FAST_RAMP_SPEED; - - for (p = freq_table; p->frequency != CPUFREQ_TABLE_END; ++p) { - unsigned int I = p->driver_data; - union SYS_clk_div_ctrl div = SYS_CLK_DIV_CTRL(I); - p->driver_data = div.val; - p->frequency = freq / I; - } - - return cpufreq_generic_init(policy, freq_table, transition_latency_ns); -} - -static struct cpufreq_driver tangox_cpufreq_driver = { - .name = "tangox-cpufreq", - .init = tangox_cpu_init, - .verify = cpufreq_generic_frequency_table_verify, - .target_index = tangox_target, - .get = tangox_get_freq, - .exit = cpufreq_generic_exit, - .attr = cpufreq_generic_attr, -}; - -static int __init tangox_cpufreq_init(void) -{ - return cpufreq_register_driver(&tangox_cpufreq_driver); -} - -static void __exit tangox_cpufreq_exit(void) -{ - cpufreq_unregister_driver(&tangox_cpufreq_driver); -} - -module_init(tangox_cpufreq_init); -module_exit(tangox_cpufreq_exit); diff --git a/a/3.hdr b/a/3.hdr deleted file mode 100644 index f31d10e..0000000 --- a/a/3.hdr +++ /dev/null @@ -1,5 +0,0 @@ -Content-Type: text/x-chdr; - name="temp.h" -Content-Transfer-Encoding: 7bit -Content-Disposition: attachment; - filename="temp.h" diff --git a/a/3.txt b/a/3.txt deleted file mode 100644 index 42a216a..0000000 --- a/a/3.txt +++ /dev/null @@ -1,12 +0,0 @@ -#define SYS_clkgen0_pll 0x10000 -#define SYS_cpuclk_div_ctrl 0x10024 -#define TANGOX_XTAL_FREQ 27000 - -#define REG(name, ...) union name { struct { u32 __VA_ARGS__; } f; u32 val; } - -REG(SYS_clkgen_pll, N:7, :6, K:3, M:3, :5, Isel:3, :3, T:1, B:1); -REG(SYS_clk_div_ctrl, F:4, :4, I:8, :4, RS:1, RE:2, BP:1, :7, BZ:1); - -#define SYS_FAST_RAMP 1 -#define SYS_FAST_RAMP_SPEED 15 /* in kHz per nanosecond */ -#define SYS_CLK_DIV_CTRL(DI) {{ .I = DI, .RE = SYS_FAST_RAMP }} diff --git a/a/content_digest b/N1/content_digest index 516576d..03fa9d3 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,12 +1,8 @@ - "From\0Mason <mpeg.blue@free.fr>\0" + "From\0mpeg.blue@free.fr (Mason)\0" "Subject\0RFC on cpufreq implementation\0" "Date\0Thu, 15 Jan 2015 18:24:29 +0100\0" - "To\0Linux ARM <linux-arm-kernel@lists.infradead.org>" - Linux PM <linux-pm@vger.kernel.org> - " cpufreq <cpufreq@vger.kernel.org>\0" - "Cc\0Rafael J. Wysocki <rjw@rjwysocki.net>" - " Viresh Kumar <viresh.kumar@linaro.org>\0" - "\01:1\0" + "To\0linux-arm-kernel@lists.infradead.org\0" + "\00:1\0" "b\0" "Hello,\n" "\n" @@ -33,111 +29,20 @@ "I'm also wondering how cpufreq and cpuidle interact? Is one a\n" "subset of the other? Are they orthogonal?\n" "\n" - Regards. - "\01:2\0" - "fn\0cpufreq.c\0" - "b\0" - "/*\n" - " * Copyright 2014 Sigma Designs\n" - " *\n" - " * This program is free software; you can redistribute it and/or modify\n" - " * it under the terms of the GNU General Public License version 2 as\n" - " * published by the Free Software Foundation.\n" - " *\n" - " */\n" - "#include <linux/module.h>\n" - "#include <linux/cpufreq.h>\n" - "#include <mach/tango4_gbus.h> /* gbus_read, gbus_write */\n" - "#include \"temp.h\"\n" - "\n" - "MODULE_LICENSE(\"GPL\");\n" - "MODULE_AUTHOR(\"Sigma Designs\");\n" - "MODULE_DESCRIPTION(\"cpufreq driver for Tangox 87xx\");\n" - "\n" - "static struct cpufreq_frequency_table freq_table[] = {\n" - "\t{ .driver_data = 1 },\n" - "\t{ .driver_data = 2 },\n" - "\t{ .driver_data = 3 },\n" - "\t{ .driver_data = 9 },\n" - "\t{ .frequency = CPUFREQ_TABLE_END },\n" - "};\n" - "\n" - "static unsigned int tangox_get_freq(unsigned int cpu)\n" - "{\n" - "\tunion SYS_clkgen_pll pll;\n" - "\tunion SYS_clk_div_ctrl div;\n" - "\n" - "\tpll.val = gbus_read_reg32(SYS_clkgen0_pll);\n" - "\tif (pll.f.Isel != 1 || pll.f.M != 0)\n" - "\t\treturn 0;\n" - "\n" - "\tdiv.val = gbus_read_reg32(SYS_cpuclk_div_ctrl);\n" - "\tif (div.f.BP != 0 || div.f.F != 0)\n" - "\t\treturn 0;\n" - "\n" - "\treturn TANGOX_XTAL_FREQ * (pll.f.N + 1) / div.f.I >> pll.f.K;\n" - "}\n" - "\n" - "static int tangox_target(struct cpufreq_policy *policy, unsigned int index)\n" - "{\n" - "\twhile (gbus_read_reg32(SYS_cpuclk_div_ctrl) >> 31)\n" - "\t\tcpu_relax();\n" - "\tgbus_write_reg32(SYS_cpuclk_div_ctrl, freq_table[index].driver_data);\n" - "\treturn 0;\n" - "}\n" - "\n" - "static int tangox_cpu_init(struct cpufreq_policy *policy)\n" - "{\n" - "\tstruct cpufreq_frequency_table *p;\n" - "\tunsigned int freq = tangox_get_freq(0);\n" - "\tunsigned int transition_latency_ns = freq / SYS_FAST_RAMP_SPEED;\n" - "\n" - "\tfor (p = freq_table; p->frequency != CPUFREQ_TABLE_END; ++p) {\n" - "\t\tunsigned int I = p->driver_data;\n" - "\t\tunion SYS_clk_div_ctrl div = SYS_CLK_DIV_CTRL(I);\n" - "\t\tp->driver_data = div.val;\n" - "\t\tp->frequency = freq / I;\n" - "\t}\n" - "\n" - "\treturn cpufreq_generic_init(policy, freq_table, transition_latency_ns);\n" - "}\n" - "\n" - "static struct cpufreq_driver tangox_cpufreq_driver = {\n" - "\t.name\t\t= \"tangox-cpufreq\",\n" - "\t.init\t\t= tangox_cpu_init,\n" - "\t.verify\t\t= cpufreq_generic_frequency_table_verify,\n" - "\t.target_index\t= tangox_target,\n" - "\t.get\t\t= tangox_get_freq,\n" - "\t.exit\t\t= cpufreq_generic_exit,\n" - "\t.attr\t\t= cpufreq_generic_attr,\n" - "};\n" - "\n" - "static int __init tangox_cpufreq_init(void)\n" - "{\n" - "\treturn cpufreq_register_driver(&tangox_cpufreq_driver);\n" - "}\n" - "\n" - "static void __exit tangox_cpufreq_exit(void)\n" - "{\n" - "\tcpufreq_unregister_driver(&tangox_cpufreq_driver);\n" - "}\n" - "\n" - "module_init(tangox_cpufreq_init);\n" - module_exit(tangox_cpufreq_exit); - "\01:3\0" - "fn\0temp.h\0" - "b\0" - "#define SYS_clkgen0_pll 0x10000\n" - "#define SYS_cpuclk_div_ctrl 0x10024\n" - "#define TANGOX_XTAL_FREQ 27000\n" - "\n" - "#define REG(name, ...) union name { struct { u32 __VA_ARGS__; } f; u32 val; }\n" - "\n" - "REG(SYS_clkgen_pll, N:7, :6, K:3, M:3, :5, Isel:3, :3, T:1, B:1);\n" - "REG(SYS_clk_div_ctrl, F:4, :4, I:8, :4, RS:1, RE:2, BP:1, :7, BZ:1);\n" - "\n" - "#define SYS_FAST_RAMP 1\n" - "#define SYS_FAST_RAMP_SPEED 15 /* in kHz per nanosecond */\n" - #define SYS_CLK_DIV_CTRL(DI) {{ .I = DI, .RE = SYS_FAST_RAMP }} + "Regards.\n" + "-------------- next part --------------\n" + "A non-text attachment was scrubbed...\n" + "Name: cpufreq.c\n" + "Type: text/x-csrc\n" + "Size: 2317 bytes\n" + "Desc: not available\n" + "URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150115/f2c475b8/attachment.bin>\n" + "-------------- next part --------------\n" + "A non-text attachment was scrubbed...\n" + "Name: temp.h\n" + "Type: text/x-chdr\n" + "Size: 466 bytes\n" + "Desc: not available\n" + URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150115/f2c475b8/attachment-0001.bin> -4ac73592ba6cd3f991e493532a63d9093f1a9fe50848d7a80f63361a2eabcafd +2150ed541639bcab557bbbd9ef1cd34ea616a2fe7024030c2a5251be48d1fb67
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.