Skip to content

Commit b93cd6a

Browse files
committed
Merge branch 'sh-fixes-for-linus' of git://github.com/pmundt/linux-sh
* 'sh-fixes-for-linus' of git://github.com/pmundt/linux-sh: mailmap: Fix up some renesas attributions sh: clkfwk: Kill off remaining debugfs cruft. drivers: sh: Kill off dead pathname for runtime PM stub. drivers: sh: Generalize runtime PM platform stub. sh: Wire up process_vm syscalls. sh: clkfwk: add clk_rate_mult_range_round() serial: sh-sci: Fix up SH-2A SCIF support. sh: Fix cached/uncaced address calculation in 29bit mode
2 parents d291ffb + ab4f75c commit b93cd6a

14 files changed

Lines changed: 82 additions & 98 deletions

File tree

‎.mailmap‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Juha Yrjola <juha.yrjola@solidboot.com>
6868
Kay Sievers <kay.sievers@vrfy.org>
6969
Kenneth W Chen <kenneth.w.chen@intel.com>
7070
Koushik <raghavendra.koushik@neterion.com>
71+
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
7172
Leonid I Ananiev <leonid.i.ananiev@intel.com>
7273
Linas Vepstas <linas@austin.ibm.com>
7374
Mark Brown <broonie@sirena.org.uk>
@@ -111,3 +112,4 @@ Uwe Kleine-König <ukl@pengutronix.de>
111112
Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
112113
Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
113114
Takashi YOSHII <takashi.yoshii.zj@renesas.com>
115+
Yusuke Goda <goda.yusuke@renesas.com>

‎arch/arm/mach-shmobile/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55
# Common objects
6-
obj-y := timer.o console.o clock.o pm_runtime.o
6+
obj-y := timer.o console.o clock.o
77

88
# CPU objects
99
obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o intc-sh7367.o

‎arch/sh/include/asm/page.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,13 @@ typedef struct page *pgtable_t;
151151
#endif /* !__ASSEMBLY__ */
152152

153153
#ifdef CONFIG_UNCACHED_MAPPING
154+
#if defined(CONFIG_29BIT)
155+
#define UNCAC_ADDR(addr) P2SEGADDR(addr)
156+
#define CAC_ADDR(addr) P1SEGADDR(addr)
157+
#else
154158
#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + uncached_start)
155159
#define CAC_ADDR(addr) ((addr) - uncached_start + PAGE_OFFSET)
160+
#endif
156161
#else
157162
#define UNCAC_ADDR(addr) ((addr))
158163
#define CAC_ADDR(addr) ((addr))

‎arch/sh/include/asm/unistd_32.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,10 @@
375375
#define __NR_syncfs 362
376376
#define __NR_sendmmsg 363
377377
#define __NR_setns 364
378+
#define __NR_process_vm_readv 365
379+
#define __NR_process_vm_writev 366
378380

379-
#define NR_syscalls 365
381+
#define NR_syscalls 367
380382

381383
#ifdef __KERNEL__
382384

‎arch/sh/include/asm/unistd_64.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,12 @@
396396
#define __NR_syncfs 373
397397
#define __NR_sendmmsg 374
398398
#define __NR_setns 375
399+
#define __NR_process_vm_readv 376
400+
#define __NR_process_vm_writev 377
399401

400402
#ifdef __KERNEL__
401403

402-
#define NR_syscalls 376
404+
#define NR_syscalls 378
403405

404406
#define __ARCH_WANT_IPC_PARSE_VERSION
405407
#define __ARCH_WANT_OLD_READDIR

‎arch/sh/kernel/cpu/sh2a/setup-sh7203.c‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,12 @@ static DECLARE_INTC_DESC(intc_desc, "sh7203", vectors, groups,
176176
static struct plat_sci_port scif0_platform_data = {
177177
.mapbase = 0xfffe8000,
178178
.flags = UPF_BOOT_AUTOCONF,
179-
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
179+
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
180+
SCSCR_REIE,
180181
.scbrr_algo_id = SCBRR_ALGO_2,
181182
.type = PORT_SCIF,
182183
.irqs = { 192, 192, 192, 192 },
184+
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
183185
};
184186

185187
static struct platform_device scif0_device = {
@@ -193,10 +195,12 @@ static struct platform_device scif0_device = {
193195
static struct plat_sci_port scif1_platform_data = {
194196
.mapbase = 0xfffe8800,
195197
.flags = UPF_BOOT_AUTOCONF,
196-
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
198+
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
199+
SCSCR_REIE,
197200
.scbrr_algo_id = SCBRR_ALGO_2,
198201
.type = PORT_SCIF,
199202
.irqs = { 196, 196, 196, 196 },
203+
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
200204
};
201205

202206
static struct platform_device scif1_device = {
@@ -210,10 +214,12 @@ static struct platform_device scif1_device = {
210214
static struct plat_sci_port scif2_platform_data = {
211215
.mapbase = 0xfffe9000,
212216
.flags = UPF_BOOT_AUTOCONF,
213-
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
217+
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
218+
SCSCR_REIE,
214219
.scbrr_algo_id = SCBRR_ALGO_2,
215220
.type = PORT_SCIF,
216221
.irqs = { 200, 200, 200, 200 },
222+
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
217223
};
218224

219225
static struct platform_device scif2_device = {
@@ -227,10 +233,12 @@ static struct platform_device scif2_device = {
227233
static struct plat_sci_port scif3_platform_data = {
228234
.mapbase = 0xfffe9800,
229235
.flags = UPF_BOOT_AUTOCONF,
230-
.scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE,
236+
.scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
237+
SCSCR_REIE,
231238
.scbrr_algo_id = SCBRR_ALGO_2,
232239
.type = PORT_SCIF,
233240
.irqs = { 204, 204, 204, 204 },
241+
.regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
234242
};
235243

236244
static struct platform_device scif3_device = {

‎arch/sh/kernel/syscalls_32.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,3 +382,5 @@ ENTRY(sys_call_table)
382382
.long sys_syncfs
383383
.long sys_sendmmsg
384384
.long sys_setns
385+
.long sys_process_vm_readv /* 365 */
386+
.long sys_process_vm_writev

‎arch/sh/kernel/syscalls_64.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,3 +402,5 @@ sys_call_table:
402402
.long sys_syncfs
403403
.long sys_sendmmsg
404404
.long sys_setns /* 375 */
405+
.long sys_process_vm_readv
406+
.long sys_process_vm_writev

‎drivers/sh/Makefile‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,11 @@ obj-$(CONFIG_HAVE_CLK) += clk/
77
obj-$(CONFIG_MAPLE) += maple/
88
obj-$(CONFIG_SUPERHYWAY) += superhyway/
99
obj-$(CONFIG_GENERIC_GPIO) += pfc.o
10+
11+
#
12+
# For the moment we only use this framework for ARM-based SH/R-Mobile
13+
# platforms and generic SH. SH-based SH-Mobile platforms are still using
14+
# an older framework that is pending up-porting, at which point this
15+
# special casing can go away.
16+
#
17+
obj-$(CONFIG_SUPERH)$(CONFIG_ARCH_SHMOBILE) += pm_runtime.o

‎drivers/sh/clk/core.c‎

Lines changed: 20 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <linux/seq_file.h>
2626
#include <linux/err.h>
2727
#include <linux/io.h>
28-
#include <linux/debugfs.h>
2928
#include <linux/cpufreq.h>
3029
#include <linux/clk.h>
3130
#include <linux/sh_clk.h>
@@ -173,6 +172,26 @@ long clk_rate_div_range_round(struct clk *clk, unsigned int div_min,
173172
return clk_rate_round_helper(&div_range_round);
174173
}
175174

175+
static long clk_rate_mult_range_iter(unsigned int pos,
176+
struct clk_rate_round_data *rounder)
177+
{
178+
return clk_get_rate(rounder->arg) * pos;
179+
}
180+
181+
long clk_rate_mult_range_round(struct clk *clk, unsigned int mult_min,
182+
unsigned int mult_max, unsigned long rate)
183+
{
184+
struct clk_rate_round_data mult_range_round = {
185+
.min = mult_min,
186+
.max = mult_max,
187+
.func = clk_rate_mult_range_iter,
188+
.arg = clk_get_parent(clk),
189+
.rate = rate,
190+
};
191+
192+
return clk_rate_round_helper(&mult_range_round);
193+
}
194+
176195
int clk_rate_table_find(struct clk *clk,
177196
struct cpufreq_frequency_table *freq_table,
178197
unsigned long rate)
@@ -205,9 +224,6 @@ int clk_reparent(struct clk *child, struct clk *parent)
205224
list_add(&child->sibling, &parent->children);
206225
child->parent = parent;
207226

208-
/* now do the debugfs renaming to reattach the child
209-
to the proper parent */
210-
211227
return 0;
212228
}
213229

@@ -665,89 +681,6 @@ static int __init clk_syscore_init(void)
665681
subsys_initcall(clk_syscore_init);
666682
#endif
667683

668-
/*
669-
* debugfs support to trace clock tree hierarchy and attributes
670-
*/
671-
static struct dentry *clk_debugfs_root;
672-
673-
static int clk_debugfs_register_one(struct clk *c)
674-
{
675-
int err;
676-
struct dentry *d;
677-
struct clk *pa = c->parent;
678-
char s[255];
679-
char *p = s;
680-
681-
p += sprintf(p, "%p", c);
682-
d = debugfs_create_dir(s, pa ? pa->dentry : clk_debugfs_root);
683-
if (!d)
684-
return -ENOMEM;
685-
c->dentry = d;
686-
687-
d = debugfs_create_u8("usecount", S_IRUGO, c->dentry, (u8 *)&c->usecount);
688-
if (!d) {
689-
err = -ENOMEM;
690-
goto err_out;
691-
}
692-
d = debugfs_create_u32("rate", S_IRUGO, c->dentry, (u32 *)&c->rate);
693-
if (!d) {
694-
err = -ENOMEM;
695-
goto err_out;
696-
}
697-
d = debugfs_create_x32("flags", S_IRUGO, c->dentry, (u32 *)&c->flags);
698-
if (!d) {
699-
err = -ENOMEM;
700-
goto err_out;
701-
}
702-
return 0;
703-
704-
err_out:
705-
debugfs_remove_recursive(c->dentry);
706-
return err;
707-
}
708-
709-
static int clk_debugfs_register(struct clk *c)
710-
{
711-
int err;
712-
struct clk *pa = c->parent;
713-
714-
if (pa && !pa->dentry) {
715-
err = clk_debugfs_register(pa);
716-
if (err)
717-
return err;
718-
}
719-
720-
if (!c->dentry) {
721-
err = clk_debugfs_register_one(c);
722-
if (err)
723-
return err;
724-
}
725-
return 0;
726-
}
727-
728-
static int __init clk_debugfs_init(void)
729-
{
730-
struct clk *c;
731-
struct dentry *d;
732-
int err;
733-
734-
d = debugfs_create_dir("clock", NULL);
735-
if (!d)
736-
return -ENOMEM;
737-
clk_debugfs_root = d;
738-
739-
list_for_each_entry(c, &clock_list, node) {
740-
err = clk_debugfs_register(c);
741-
if (err)
742-
goto err_out;
743-
}
744-
return 0;
745-
err_out:
746-
debugfs_remove_recursive(clk_debugfs_root);
747-
return err;
748-
}
749-
late_initcall(clk_debugfs_init);
750-
751684
static int __init clk_late_init(void)
752685
{
753686
unsigned long flags;

0 commit comments

Comments
 (0)