aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-12 00:34:19 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-12 00:34:19 -0500
commit66a173b926891023e34e78cb32f4681d19777e01 (patch)
treee6018f50fbceea7c07e6e27368ee817f9adb34f2 /drivers/tty
parent11db81a59d0b2e563e30512cd76f23d0db384780 (diff)
parent0c4888ef1d8a8b82c29075ce7e257ff795af15c7 (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc updates from Benjamin Herrenschmidt: "The bulk of this is LE updates. One should now be able to build an LE kernel and even run some things in it. I'm still sitting on a handful of patches to enable the new ABI that I *might* still send this merge window around, but due to the incertainty (they are pretty fresh) I want to keep them separate. Other notable changes are some infrastructure bits to better handle PCI pass-through under KVM, some bits and pieces added to the new PowerNV platform support such as access to the CPU SCOM bus via sysfs, and support for EEH error handling on PHB3 (Power8 PCIe). We also grew arch_get_random_long() for both pseries and powernv when running on P7+ and P8, exploiting the HW rng. And finally various embedded updates from freescale" * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (154 commits) powerpc: Fix fatal SLB miss when restoring PPR powerpc/powernv: Reserve the correct PE number powerpc/powernv: Add PE to its own PELTV powerpc/powernv: Add support for indirect XSCOM via debugfs powerpc/scom: Improve debugfs interface powerpc/scom: Enable 64-bit addresses powerpc/boot: Properly handle the base "of" boot wrapper powerpc/bpf: Support MOD operation powerpc/bpf: Fix DIVWU instruction opcode of: Move definition of of_find_next_cache_node into common code. powerpc: Remove big endianness assumption in of_find_next_cache_node powerpc/tm: Remove interrupt disable in __switch_to() powerpc: word-at-a-time optimization for 64-bit Little Endian powerpc/bpf: BPF JIT compiler for 64-bit Little Endian powerpc: Only save/restore SDR1 if in hypervisor mode powerpc/pmu: Fix ADB_PMU_LED_IDE dependencies powerpc/nvram: Fix endian issue when using the partition length powerpc/nvram: Fix endian issue when reading the NVRAM size powerpc/nvram: Scan partitions only once powerpc/mpc512x: remove unnecessary #if ...
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/hvc/hvc_opal.c4
-rw-r--r--drivers/tty/hvc/hvsi_lib.c25
2 files changed, 14 insertions, 15 deletions
diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c
index cd69b48f6dfd..6496872e2e47 100644
--- a/drivers/tty/hvc/hvc_opal.c
+++ b/drivers/tty/hvc/hvc_opal.c
@@ -329,7 +329,7 @@ static void udbg_init_opal_common(void)
329void __init hvc_opal_init_early(void) 329void __init hvc_opal_init_early(void)
330{ 330{
331 struct device_node *stdout_node = NULL; 331 struct device_node *stdout_node = NULL;
332 const u32 *termno; 332 const __be32 *termno;
333 const char *name = NULL; 333 const char *name = NULL;
334 const struct hv_ops *ops; 334 const struct hv_ops *ops;
335 u32 index; 335 u32 index;
@@ -371,7 +371,7 @@ void __init hvc_opal_init_early(void)
371 if (!stdout_node) 371 if (!stdout_node)
372 return; 372 return;
373 termno = of_get_property(stdout_node, "reg", NULL); 373 termno = of_get_property(stdout_node, "reg", NULL);
374 index = termno ? *termno : 0; 374 index = termno ? be32_to_cpup(termno) : 0;
375 if (index >= MAX_NR_HVC_CONSOLES) 375 if (index >= MAX_NR_HVC_CONSOLES)
376 return; 376 return;
377 hvc_opal_privs[index] = &hvc_opal_boot_priv; 377 hvc_opal_privs[index] = &hvc_opal_boot_priv;
diff --git a/drivers/tty/hvc/hvsi_lib.c b/drivers/tty/hvc/hvsi_lib.c
index ac2767100df5..347050ea414a 100644
--- a/drivers/tty/hvc/hvsi_lib.c
+++ b/drivers/tty/hvc/hvsi_lib.c
@@ -9,7 +9,7 @@
9 9
10static int hvsi_send_packet(struct hvsi_priv *pv, struct hvsi_header *packet) 10static int hvsi_send_packet(struct hvsi_priv *pv, struct hvsi_header *packet)
11{ 11{
12 packet->seqno = atomic_inc_return(&pv->seqno); 12 packet->seqno = cpu_to_be16(atomic_inc_return(&pv->seqno));
13 13
14 /* Assumes that always succeeds, works in practice */ 14 /* Assumes that always succeeds, works in practice */
15 return pv->put_chars(pv->termno, (char *)packet, packet->len); 15 return pv->put_chars(pv->termno, (char *)packet, packet->len);
@@ -28,7 +28,7 @@ static void hvsi_start_handshake(struct hvsi_priv *pv)
28 /* Send version query */ 28 /* Send version query */
29 q.hdr.type = VS_QUERY_PACKET_HEADER; 29 q.hdr.type = VS_QUERY_PACKET_HEADER;
30 q.hdr.len = sizeof(struct hvsi_query); 30 q.hdr.len = sizeof(struct hvsi_query);
31 q.verb = VSV_SEND_VERSION_NUMBER; 31 q.verb = cpu_to_be16(VSV_SEND_VERSION_NUMBER);
32 hvsi_send_packet(pv, &q.hdr); 32 hvsi_send_packet(pv, &q.hdr);
33} 33}
34 34
@@ -40,7 +40,7 @@ static int hvsi_send_close(struct hvsi_priv *pv)
40 40
41 ctrl.hdr.type = VS_CONTROL_PACKET_HEADER; 41 ctrl.hdr.type = VS_CONTROL_PACKET_HEADER;
42 ctrl.hdr.len = sizeof(struct hvsi_control); 42 ctrl.hdr.len = sizeof(struct hvsi_control);
43 ctrl.verb = VSV_CLOSE_PROTOCOL; 43 ctrl.verb = cpu_to_be16(VSV_CLOSE_PROTOCOL);
44 return hvsi_send_packet(pv, &ctrl.hdr); 44 return hvsi_send_packet(pv, &ctrl.hdr);
45} 45}
46 46
@@ -69,14 +69,14 @@ static void hvsi_got_control(struct hvsi_priv *pv)
69{ 69{
70 struct hvsi_control *pkt = (struct hvsi_control *)pv->inbuf; 70 struct hvsi_control *pkt = (struct hvsi_control *)pv->inbuf;
71 71
72 switch (pkt->verb) { 72 switch (be16_to_cpu(pkt->verb)) {
73 case VSV_CLOSE_PROTOCOL: 73 case VSV_CLOSE_PROTOCOL:
74 /* We restart the handshaking */ 74 /* We restart the handshaking */
75 hvsi_start_handshake(pv); 75 hvsi_start_handshake(pv);
76 break; 76 break;
77 case VSV_MODEM_CTL_UPDATE: 77 case VSV_MODEM_CTL_UPDATE:
78 /* Transition of carrier detect */ 78 /* Transition of carrier detect */
79 hvsi_cd_change(pv, pkt->word & HVSI_TSCD); 79 hvsi_cd_change(pv, be32_to_cpu(pkt->word) & HVSI_TSCD);
80 break; 80 break;
81 } 81 }
82} 82}
@@ -87,7 +87,7 @@ static void hvsi_got_query(struct hvsi_priv *pv)
87 struct hvsi_query_response r; 87 struct hvsi_query_response r;
88 88
89 /* We only handle version queries */ 89 /* We only handle version queries */
90 if (pkt->verb != VSV_SEND_VERSION_NUMBER) 90 if (be16_to_cpu(pkt->verb) != VSV_SEND_VERSION_NUMBER)
91 return; 91 return;
92 92
93 pr_devel("HVSI@%x: Got version query, sending response...\n", 93 pr_devel("HVSI@%x: Got version query, sending response...\n",
@@ -96,7 +96,7 @@ static void hvsi_got_query(struct hvsi_priv *pv)
96 /* Send version response */ 96 /* Send version response */
97 r.hdr.type = VS_QUERY_RESPONSE_PACKET_HEADER; 97 r.hdr.type = VS_QUERY_RESPONSE_PACKET_HEADER;
98 r.hdr.len = sizeof(struct hvsi_query_response); 98 r.hdr.len = sizeof(struct hvsi_query_response);
99 r.verb = VSV_SEND_VERSION_NUMBER; 99 r.verb = cpu_to_be16(VSV_SEND_VERSION_NUMBER);
100 r.u.version = HVSI_VERSION; 100 r.u.version = HVSI_VERSION;
101 r.query_seqno = pkt->hdr.seqno; 101 r.query_seqno = pkt->hdr.seqno;
102 hvsi_send_packet(pv, &r.hdr); 102 hvsi_send_packet(pv, &r.hdr);
@@ -112,7 +112,7 @@ static void hvsi_got_response(struct hvsi_priv *pv)
112 112
113 switch(r->verb) { 113 switch(r->verb) {
114 case VSV_SEND_MODEM_CTL_STATUS: 114 case VSV_SEND_MODEM_CTL_STATUS:
115 hvsi_cd_change(pv, r->u.mctrl_word & HVSI_TSCD); 115 hvsi_cd_change(pv, be32_to_cpu(r->u.mctrl_word) & HVSI_TSCD);
116 pv->mctrl_update = 1; 116 pv->mctrl_update = 1;
117 break; 117 break;
118 } 118 }
@@ -265,8 +265,7 @@ int hvsilib_read_mctrl(struct hvsi_priv *pv)
265 pv->mctrl_update = 0; 265 pv->mctrl_update = 0;
266 q.hdr.type = VS_QUERY_PACKET_HEADER; 266 q.hdr.type = VS_QUERY_PACKET_HEADER;
267 q.hdr.len = sizeof(struct hvsi_query); 267 q.hdr.len = sizeof(struct hvsi_query);
268 q.hdr.seqno = atomic_inc_return(&pv->seqno); 268 q.verb = cpu_to_be16(VSV_SEND_MODEM_CTL_STATUS);
269 q.verb = VSV_SEND_MODEM_CTL_STATUS;
270 rc = hvsi_send_packet(pv, &q.hdr); 269 rc = hvsi_send_packet(pv, &q.hdr);
271 if (rc <= 0) { 270 if (rc <= 0) {
272 pr_devel("HVSI@%x: Error %d...\n", pv->termno, rc); 271 pr_devel("HVSI@%x: Error %d...\n", pv->termno, rc);
@@ -304,9 +303,9 @@ int hvsilib_write_mctrl(struct hvsi_priv *pv, int dtr)
304 303
305 ctrl.hdr.type = VS_CONTROL_PACKET_HEADER, 304 ctrl.hdr.type = VS_CONTROL_PACKET_HEADER,
306 ctrl.hdr.len = sizeof(struct hvsi_control); 305 ctrl.hdr.len = sizeof(struct hvsi_control);
307 ctrl.verb = VSV_SET_MODEM_CTL; 306 ctrl.verb = cpu_to_be16(VSV_SET_MODEM_CTL);
308 ctrl.mask = HVSI_TSDTR; 307 ctrl.mask = cpu_to_be32(HVSI_TSDTR);
309 ctrl.word = dtr ? HVSI_TSDTR : 0; 308 ctrl.word = cpu_to_be32(dtr ? HVSI_TSDTR : 0);
310 return hvsi_send_packet(pv, &ctrl.hdr); 309 return hvsi_send_packet(pv, &ctrl.hdr);
311} 310}
312 311