aboutsummaryrefslogtreecommitdiff
path: root/arch/mips/jmr3927/common
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/jmr3927/common')
-rw-r--r--arch/mips/jmr3927/common/prom.c12
-rw-r--r--arch/mips/jmr3927/common/puts.c122
2 files changed, 9 insertions, 125 deletions
diff --git a/arch/mips/jmr3927/common/prom.c b/arch/mips/jmr3927/common/prom.c
index aa481b774c4..5398813e50e 100644
--- a/arch/mips/jmr3927/common/prom.c
+++ b/arch/mips/jmr3927/common/prom.c
@@ -41,16 +41,6 @@
#include <asm/bootinfo.h>
-extern int prom_argc;
-extern char **prom_argv, **prom_envp;
-
-typedef struct
-{
- char *name;
-/* char *val; */
-}t_env_var;
-
-
char * __init prom_getcmdline(void)
{
return &(arcs_cmdline[0]);
@@ -60,6 +50,8 @@ void __init prom_init_cmdline(void)
{
char *cp;
int actr;
+ int prom_argc = fw_arg0;
+ char **prom_argv = (char **) fw_arg1;
actr = 1; /* Always ignore argv[0] */
diff --git a/arch/mips/jmr3927/common/puts.c b/arch/mips/jmr3927/common/puts.c
index 1c1cad9cd07..c611ab49788 100644
--- a/arch/mips/jmr3927/common/puts.c
+++ b/arch/mips/jmr3927/common/puts.c
@@ -32,137 +32,29 @@
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <linux/types.h>
-#include <asm/jmr3927/txx927.h>
#include <asm/jmr3927/tx3927.h>
-#include <asm/jmr3927/jmr3927.h>
#define TIMEOUT 0xffffff
-#define SLOW_DOWN
-
-static const char digits[16] = "0123456789abcdef";
-
-#ifdef SLOW_DOWN
-#define slow_down() { int k; for (k=0; k<10000; k++); }
-#else
-#define slow_down()
-#endif
void
-putch(const unsigned char c)
+prom_putchar(char c)
{
int i = 0;
do {
- slow_down();
i++;
- if (i>TIMEOUT) {
+ if (i>TIMEOUT)
break;
- }
} while (!(tx3927_sioptr(1)->cisr & TXx927_SICISR_TXALS));
tx3927_sioptr(1)->tfifo = c;
return;
}
-unsigned char getch(void)
-{
- int i = 0;
- int dicr;
- char c;
-
- /* diable RX int. */
- dicr = tx3927_sioptr(1)->dicr;
- tx3927_sioptr(1)->dicr = 0;
-
- do {
- slow_down();
- i++;
- if (i>TIMEOUT) {
- break;
- }
- } while (tx3927_sioptr(1)->disr & TXx927_SIDISR_UVALID)
- ;
- c = tx3927_sioptr(1)->rfifo;
-
- /* clear RX int. status */
- tx3927_sioptr(1)->disr &= ~TXx927_SIDISR_RDIS;
- /* enable RX int. */
- tx3927_sioptr(1)->dicr = dicr;
-
- return c;
-}
-void
-do_jmr3927_led_set(char n)
-{
- /* and with current leds */
- jmr3927_led_and_set(n);
-}
-
void
-puts(unsigned char *cp)
+puts(const char *cp)
{
- int i = 0;
-
- while (*cp) {
- do {
- slow_down();
- i++;
- if (i>TIMEOUT) {
- break;
- }
- } while (!(tx3927_sioptr(1)->cisr & TXx927_SICISR_TXALS));
- tx3927_sioptr(1)->tfifo = *cp++;
- }
- putch('\r');
- putch('\n');
-}
-
-void
-fputs(unsigned char *cp)
-{
- int i = 0;
-
- while (*cp) {
- do {
- slow_down();
- i++;
- if (i>TIMEOUT) {
- break;
- }
- } while (!(tx3927_sioptr(1)->cisr & TXx927_SICISR_TXALS));
- tx3927_sioptr(1)->tfifo = *cp++;
- }
-}
-
-
-void
-put64(uint64_t ul)
-{
- int cnt;
- unsigned ch;
-
- cnt = 16; /* 16 nibbles in a 64 bit long */
- putch('0');
- putch('x');
- do {
- cnt--;
- ch = (unsigned char)(ul >> cnt * 4) & 0x0F;
- putch(digits[ch]);
- } while (cnt > 0);
-}
-
-void
-put32(unsigned u)
-{
- int cnt;
- unsigned ch;
-
- cnt = 8; /* 8 nibbles in a 32 bit long */
- putch('0');
- putch('x');
- do {
- cnt--;
- ch = (unsigned char)(u >> cnt * 4) & 0x0F;
- putch(digits[ch]);
- } while (cnt > 0);
+ while (*cp)
+ prom_putchar(*cp++);
+ prom_putchar('\r');
+ prom_putchar('\n');
}