Skip to contentSkip to conversation

msm: generalize clock support.

PATCH New Daniel Walker 4 participants 9 messages May 12, 2010 – May 29, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 5/25 msm: generalize clock support.

The 'PCOM' method of clock control (commands issued to the radio CPU) is shared across several (but not all) Qualcomm SOCs. Generalize this clock mechanism so these other SOCs can be added.

---
 arch/arm/mach-msm/Makefile             |    2 +-
 arch/arm/mach-msm/board-halibut.c      |    2 +-
 arch/arm/mach-msm/board-trout.c        |    2 +-
 arch/arm/mach-msm/clock-7x01a.c        |  126 ----------------
 arch/arm/mach-msm/clock-pcom.c         |  131 ++++++++++++++++
 arch/arm/mach-msm/clock-pcom.h         |  153 +++++++++++++++++++
 arch/arm/mach-msm/clock.c              |  257 +++++++++++++++++++++++---------
 arch/arm/mach-msm/clock.h              |   70 ++++++++-
 arch/arm/mach-msm/devices-msm7x00.c    |   47 ++++++
 arch/arm/mach-msm/devices.h            |    5 +
 arch/arm/mach-msm/include/mach/board.h |    5 +-
 arch/arm/mach-msm/include/mach/clk.h   |   57 +++++++
 12 files changed, 651 insertions(+), 206 deletions(-)
 delete mode 100644 arch/arm/mach-msm/clock-7x01a.c
 create mode 100644 arch/arm/mach-msm/clock-pcom.c
 create mode 100644 arch/arm/mach-msm/clock-pcom.h
 create mode 100644 arch/arm/mach-msm/include/mach/clk.h
arch/arm/mach-msm/Makefile +1 -1
index 435d83c..70fa970 100644
@@ -2,7 +2,7 @@ obj-y += io.o idle.o irq.o timer.o dma.o
 obj-y += proc_comm.o
 obj-y += vreg.o
 obj-y += acpuclock-arm11.o
-obj-y += clock.o clock-7x01a.o
+obj-y += clock.o clock-pcom.o
 
 obj-$(CONFIG_MSM_SMD) += smd.o smd_debug.o
 obj-$(CONFIG_MSM_SMD) += last_radio_log.o
arch/arm/mach-msm/board-halibut.c +1 -1
index acc2288..7bd72e8 100644
@@ -90,7 +90,7 @@ static void __init halibut_fixup(struct machine_desc *desc, struct tag *tags,
 static void __init halibut_map_io(void)
 {
 	msm_map_common_io();
-	msm_clock_init();
+	msm_clock_init(msm_clocks_7x01a, msm_num_clocks_7x01a);
 }
 
 MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
arch/arm/mach-msm/board-trout.c +1 -1
index b88aec2..dca5a5f 100644
@@ -78,7 +78,7 @@ static void __init trout_map_io(void)
 	writeb(0x80, TROUT_CPLD_BASE + 0x00);
 #endif
 
-	msm_clock_init();
+	msm_clock_init(msm_clocks_7x01a, msm_num_clocks_7x01a);
 }
 
 MACHINE_START(TROUT, "HTC Dream")
arch/arm/mach-msm/clock-7x01a.c deleted +0 -126

126 lines not on this page · raw message

arch/arm/mach-msm/clock-pcom.c new file +131 -0

131 lines not on this page · raw message

arch/arm/mach-msm/clock-pcom.h new file +153 -0

153 lines not on this page · raw message

arch/arm/mach-msm/clock.c +187 -70

332 lines not on this page · raw message

arch/arm/mach-msm/clock.h +65 -5

100 lines not on this page · raw message

arch/arm/mach-msm/devices-msm7x00.c +47 -0

56 lines not on this page · raw message

arch/arm/mach-msm/devices.h +5 -0
index 0744c4a..19c5de9 100644
@@ -16,6 +16,8 @@
 #ifndef __ARCH_ARM_MACH_MSM_DEVICES_H
 #define __ARCH_ARM_MACH_MSM_DEVICES_H
 
+#include "clock.h"
+
 extern struct platform_device msm_device_uart1;
 extern struct platform_device msm_device_uart2;
 extern struct platform_device msm_device_uart3;
@@ -33,4 +35,7 @@ extern struct platform_device msm_device_smd;
 
 extern struct platform_device msm_device_nand;
 
+extern struct clk msm_clocks_7x01a[];
+extern unsigned msm_num_clocks_7x01a;
+
 #endif
arch/arm/mach-msm/include/mach/board.h +3 -2
index 7933641..e302fbd 100644
@@ -30,14 +30,15 @@ struct msm_acpu_clock_platform_data
 	unsigned long wait_for_irq_khz;
 };
 
-  
+struct clk;
+
 /* common init routines for use by arch/arm/mach-msm/board-*.c */
 
 void __init msm_add_devices(void);
 void __init msm_map_common_io(void);
 void __init msm_init_irq(void);
 void __init msm_init_gpio(void);
-void __init msm_clock_init(void);
+void __init msm_clock_init(struct clk *clock_tbl, unsigned num_clocks);
 void __init msm_acpu_clock_init(struct msm_acpu_clock_platform_data *);
 
 #endif
arch/arm/mach-msm/include/mach/clk.h new file +57 -0

57 lines not on this page · raw message

Signature · 1 line
1.6.2.3
#1 lore raw

PATCH 5/25 msm: generalize clock support.

Hi!

Quoted 7 lines
arch/arm/mach-msm/clock-pcom.h new file +4 -0
@@ -0,0 +1,153 @@
+/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are

arch/arm/mach-msm/clock-pcom.h line 14

Quoted 10 lines
arch/arm/mach-msm/clock-pcom.h new file +10 -0
+ * met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *     * Neither the name of Code Aurora Forum, Inc. nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.

Is this even GPL compatible?

arch/arm/mach-msm/clock.c line 7

Quoted 13 lines
arch/arm/mach-msm/clock.c +1 -1
index 3b1ce36..34c6a52 100644
@@ -1,7 +1,7 @@
 /* arch/arm/mach-msm/clock.c
  *
  * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2007 QUALCOMM Incorporated
+ * Copyright (c) 2007-2010, Code Aurora Forum. All rights reserved.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and

So... what is the relationship between qualcomm and Code Aurora?

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#2 lore raw

PATCH 5/25 msm: generalize clock support.

Quoted 17 lines

Hi!

Quoted 15 lines
arch/arm/mach-msm/clock-pcom.h new file +4 -0
@@ -0,0 +1,153 @@
+/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions

are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
provided

Quoted 8 lines
Quoted 6 lines

+ * with the distribution.
+ * * Neither the name of Code Aurora Forum, Inc. nor the names of
its
+ * contributors may be used to endorse or promote products
derived
+ * from this software without specific prior written permission.

Is this even GPL compatible?

It's a modified BSD type license, so yeah I think it would be compatible. However, it's all suppose to be GPL'd so I think we'll want to remove this.

Quoted 7 lines
Quoted 7 lines
arch/arm/mach-msm/clock.c +0 -0
index 3b1ce36..34c6a52 100644
@@ -1,7 +1,7 @@
 /* arch/arm/mach-msm/clock.c
  *
Quoted 8 lines

arch/arm/mach-msm/clock.c line 7

Quoted 6 lines
arch/arm/mach-msm/clock.c +1 -1
  * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2007 QUALCOMM Incorporated
+ * Copyright (c) 2007-2010, Code Aurora Forum. All rights reserved.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and

So... what is the relationship between qualcomm and Code Aurora?

My understanding of it is that Code Aurora is an external entity which is operated by multiple other companies. We use Code Aurora to distribute the source code .. The line above is just assigning the copyright to Code Aurora which is part of how we distribute the source.

Daniel

#3 lore raw

PATCH 5/25 msm: generalize clock support.

In reply to Pavel Machek
Quoted 5 lines · Pavel Machek
Quoted 3 lines

+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:

Is this even GPL compatible?

Um, this is a standard 3-clause BSD license. There are nearly 900 existing files in the kernel that have this license on them.

Quoted 4 lines
Quoted 2 lines

- * Copyright (c) 2007 QUALCOMM Incorporated
+ * Copyright (c) 2007-2010, Code Aurora Forum. All rights reserved.

So... what is the relationship between qualcomm and Code Aurora?

<http://www.qualcomm.com/quicinc/>
<https://www.codeaurora.org/learn/>

The Qualcomm Innovation Center, Inc. is a wholly owned subsidiary of Qualcomm, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

We have assigned copyright to the Code Aurora Forum, so have changed the copyrights to indicate that.

David

--
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

#4 lore raw

PATCH 5/25 msm: generalize clock support.

Quoted 10 lines · David Brown
Quoted 5 lines · Pavel Machek
Quoted 3 lines

+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:

Is this even GPL compatible?

Um, this is a standard 3-clause BSD license. There are nearly 900 existing files in the kernel that have this license on them.

Are you sure? I believe that Dual GPL/BSD is ok, just BSD is not.

pavel at amd:/data/l/linux-good$ less ./include/linux/license.h #ifndef __LICENSE_H
#define __LICENSE_H

static inline int license_is_gpl_compatible(const char *license)

{
        return (strcmp(license, "GPL") == 0
                || strcmp(license, "GPL v2") == 0
                || strcmp(license, "GPL and additional rights") == 0
                || strcmp(license, "Dual BSD/GPL") == 0
                || strcmp(license, "Dual MIT/GPL") == 0
                || strcmp(license, "Dual MPL/GPL") == 0);
}

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#5 lore raw

PATCH 5/25 msm: generalize clock support.

Quoted 4 lines · Pavel Machek
Quoted 2 lines

Um, this is a standard 3-clause BSD license. There are nearly 900 existing files in the kernel that have this license on them.

Are you sure? I believe that Dual GPL/BSD is ok, just BSD is not.

It is, according to the FSF
<http://www.gnu.org/licenses/license-list.html>

David

#6 lore raw

PATCH 5/25 msm: generalize clock support.

Quoted 9 lines · David Brown
Quoted 4 lines · Pavel Machek
Quoted 2 lines

Um, this is a standard 3-clause BSD license. There are nearly 900 existing files in the kernel that have this license on them.

Are you sure? I believe that Dual GPL/BSD is ok, just BSD is not.

It is, according to the FSF
<http://www.gnu.org/licenses/license-list.html>

Not acording to kernel sources. Please make it dual GPL/BSD.

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#7 lore raw

PATCH 5/25 msm: generalize clock support.

Quoted 6 lines · Pavel Machek
Quoted 4 lines
Quoted 1 line

Are you sure? I believe that Dual GPL/BSD is ok, just BSD is not.

It is, according to the FSF
<http://www.gnu.org/licenses/license-list.html>

Not acording to kernel sources. Please make it dual GPL/BSD.

If this is actually necessary, we can go back and wrangle another license change, but it is a fairly painful and unpleasant process.

We changed to this license initially because of an objection to a dual license (admittedly a poorly worded one).

The BSD license is compatible with the GPL, and it should not be necessary to add any kind of dual license to it.

David

#8 lore raw

PATCH 5/25 msm: generalize clock support.

In reply to Pavel Machek
Quoted 6 lines · Pavel Machek
Quoted 5 lines · David Brown
Quoted 3 lines · Pavel Machek
Quoted 2 lines

Um, this is a standard 3-clause BSD license. There are nearly 900 existing files in the kernel that have this license on them.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Are you sure? I believe that Dual GPL/BSD is ok, just BSD is not.

It is, according to the FSF
<http://www.gnu.org/licenses/license-list.html>

Not acording to kernel sources. Please make it dual GPL/BSD.

Glibc contains many source files with only a BSD license header, and various other GPL-compatible licenses.

If it's fine for Glibc, I believe it is surely fine for Linux.

Pavel, do you mean something specific by "not according to kernel sources"?

-- Jamie