Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0921f1ef authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull CRIS changes from Jesper Nilsson:
 "Mostly another batch of code removal due to move to standard
  frameworks for CRISv32, initial devicetree configuration for a couple
  of boards, and some small fixes for kgdb and time handling"

* tag 'cris-for-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/jesper/cris:
  cris: Drop reference to get_cmos_time()
  CRIS: Drop code related to obsolete or unused kconfigs
  cris: time: Cleanup of persistent clock stuff
  cris: re-use helpers to dump data in hex format
  CRIS v32: remove old GPIO and LEDs code
  CRIS v32: remove I2C bitbanging driver
  CRIS v32: add ARTPEC-3 and P1343 device trees
  CRIS v32: dev88: add GPIO, LEDs, RTC, temp sensor
  CRIS: add dt-bindings symlink
  CRIS v32: increase NR_IRQS
  cris: arch-v10: kgdb: Add '__used' for static variable is_dyn_brkp
  cris: arch-v10: kgdb: Use BAR instead of DTP0 for register P12
  cris: kgdb: use native hex2bin
parents 15f93405 4247896f
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -57,7 +57,6 @@ config CRIS
	select ARCH_WANT_IPC_PARSE_VERSION
	select GENERIC_IRQ_SHOW
	select GENERIC_IOMAP
	select GENERIC_CMOS_UPDATE
	select MODULES_USE_ELF_RELA
	select CLONE_BACKWARDS2
	select OLD_SIGSUSPEND
+0 −106
Original line number Diff line number Diff line
@@ -354,63 +354,6 @@ no_command_line:
	blo	1b
	nop

#ifdef CONFIG_BLK_DEV_ETRAXIDE
	;; disable ATA before enabling it in genconfig below
	moveq	0,$r0
	move.d	$r0,[R_ATA_CTRL_DATA]
	move.d	$r0,[R_ATA_TRANSFER_CNT]
	move.d	$r0,[R_ATA_CONFIG]
#if 0
	move.d	R_PORT_G_DATA, $r1
	move.d	$r0, [$r1]; assert ATA bus-reset
	nop
	nop
	nop
	nop
	nop
	nop
	move.d	0x08000000,$r0
	move.d	$r0,[$r1]
#endif
#endif

#ifdef CONFIG_JULIETTE
	;; configure external DMA channel 0 before enabling it in genconfig

	moveq	0,$r0
	move.d	$r0,[R_EXT_DMA_0_ADDR]
	; cnt enable, word size, output, stop, size 0
	move.d	  IO_STATE (R_EXT_DMA_0_CMD, cnt, enable)	\
		| IO_STATE (R_EXT_DMA_0_CMD, rqpol, ahigh)	\
		| IO_STATE (R_EXT_DMA_0_CMD, apol, ahigh)	\
		| IO_STATE (R_EXT_DMA_0_CMD, rq_ack, burst)	\
		| IO_STATE (R_EXT_DMA_0_CMD, wid, word)		\
		| IO_STATE (R_EXT_DMA_0_CMD, dir, output)	\
		| IO_STATE (R_EXT_DMA_0_CMD, run, stop)		\
		| IO_FIELD (R_EXT_DMA_0_CMD, trf_count, 0),$r0
	move.d	$r0,[R_EXT_DMA_0_CMD]

	;; reset dma4 and wait for completion

	moveq	IO_STATE (R_DMA_CH4_CMD, cmd, reset),$r0
	move.b	$r0,[R_DMA_CH4_CMD]
1:	move.b	[R_DMA_CH4_CMD],$r0
	and.b	IO_MASK (R_DMA_CH4_CMD, cmd),$r0
	cmp.b	IO_STATE (R_DMA_CH4_CMD, cmd, reset),$r0
	beq	1b
	nop

	;; reset dma5 and wait for completion

	moveq	IO_STATE (R_DMA_CH5_CMD, cmd, reset),$r0
	move.b	$r0,[R_DMA_CH5_CMD]
1:	move.b	[R_DMA_CH5_CMD],$r0
	and.b	IO_MASK (R_DMA_CH5_CMD, cmd),$r0
	cmp.b	IO_STATE (R_DMA_CH5_CMD, cmd, reset),$r0
	beq	1b
	nop
#endif

	;; Etrax product HW genconfig setup

	moveq	0,$r0
@@ -447,21 +390,6 @@ no_command_line:
		| IO_STATE (R_GEN_CONFIG, dma9, usb),$r0


#if defined(CONFIG_ETRAX_DEF_R_PORT_G0_DIR_OUT)
        or.d      IO_STATE (R_GEN_CONFIG, g0dir, out),$r0
#endif

#if defined(CONFIG_ETRAX_DEF_R_PORT_G8_15_DIR_OUT)
        or.d      IO_STATE (R_GEN_CONFIG, g8_15dir, out),$r0
#endif
#if defined(CONFIG_ETRAX_DEF_R_PORT_G16_23_DIR_OUT)
       or.d      IO_STATE (R_GEN_CONFIG, g16_23dir, out),$r0
#endif

#if defined(CONFIG_ETRAX_DEF_R_PORT_G24_DIR_OUT)
       or.d      IO_STATE (R_GEN_CONFIG, g24dir, out),$r0
#endif

	move.d	$r0,[genconfig_shadow] ; init a shadow register of R_GEN_CONFIG

	move.d	$r0,[R_GEN_CONFIG]
@@ -500,19 +428,9 @@ no_command_line:
	;; including their shadow registers

	move.b	CONFIG_ETRAX_DEF_R_PORT_PA_DIR,$r0
#if defined(CONFIG_BLUETOOTH) && defined(CONFIG_BLUETOOTH_RESET_PA7)
	or.b	IO_STATE (R_PORT_PA_DIR, dir7, output),$r0
#endif
	move.b	$r0,[port_pa_dir_shadow]
	move.b	$r0,[R_PORT_PA_DIR]
	move.b	CONFIG_ETRAX_DEF_R_PORT_PA_DATA,$r0
#if defined(CONFIG_BLUETOOTH) && defined(CONFIG_BLUETOOTH_RESET_PA7)
#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH)
	and.b	~(1 << 7),$r0
#else
	or.b	(1 << 7),$r0
#endif
#endif
	move.b	$r0,[port_pa_data_shadow]
	move.b	$r0,[R_PORT_PA_DATA]

@@ -520,19 +438,9 @@ no_command_line:
	move.b	$r0,[port_pb_config_shadow]
	move.b	$r0,[R_PORT_PB_CONFIG]
	move.b	CONFIG_ETRAX_DEF_R_PORT_PB_DIR,$r0
#if defined(CONFIG_BLUETOOTH) && defined(CONFIG_BLUETOOTH_RESET_PB5)
	or.b	IO_STATE (R_PORT_PB_DIR, dir5, output),$r0
#endif
	move.b	$r0,[port_pb_dir_shadow]
	move.b	$r0,[R_PORT_PB_DIR]
	move.b	CONFIG_ETRAX_DEF_R_PORT_PB_DATA,$r0
#if defined(CONFIG_BLUETOOTH) && defined(CONFIG_BLUETOOTH_RESET_PB5)
#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH)
	and.b	~(1 << 5),$r0
#else
	or.b	(1 << 5),$r0
#endif
#endif
	move.b	$r0,[port_pb_data_shadow]
	move.b	$r0,[R_PORT_PB_DATA]

@@ -541,20 +449,6 @@ no_command_line:
	move.d  $r0, [R_PORT_PB_I2C]

	moveq	0,$r0
#if defined(CONFIG_BLUETOOTH) && defined(CONFIG_BLUETOOTH_RESET_G10)
#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH)
	and.d	~(1 << 10),$r0
#else
	or.d	(1 << 10),$r0
#endif
#endif
#if defined(CONFIG_BLUETOOTH) && defined(CONFIG_BLUETOOTH_RESET_G11)
#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH)
	and.d	~(1 << 11),$r0
#else
	or.d	(1 << 11),$r0
#endif
#endif
	move.d	$r0,[port_g_data_shadow]
	move.d	$r0,[R_PORT_G_DATA]

+36 −53
Original line number Diff line number Diff line
@@ -275,7 +275,7 @@ static char remcomOutBuffer[BUFMAX];
/* Error and warning messages. */
enum error_type
{
	SUCCESS, E01, E02, E03, E04, E05, E06, E07
	SUCCESS, E01, E02, E03, E04, E05, E06, E07, E08
};
static char *error_message[] =
{
@@ -286,7 +286,8 @@ static char *error_message[] =
	"E04 The command is not supported - [s,C,S,!,R,d,r] - internal error.",
	"E05 Change register content - P - the register is not implemented..",
	"E06 Change memory content - M - internal error.",
	"E07 Change register content - P - the register is not stored on the stack"
	"E07 Change register content - P - the register is not stored on the stack",
	"E08 Invalid parameter"
};
/********************************* Register image ****************************/
/* Use the order of registers as defined in "AXIS ETRAX CRIS Programmer's
@@ -351,7 +352,7 @@ char internal_stack[INTERNAL_STACK_SIZE];
   breakpoint to be handled. A static breakpoint uses the content of register
   BRP as it is whereas a dynamic breakpoint requires subtraction with 2
   in order to execute the instruction. The first breakpoint is static. */
static unsigned char is_dyn_brkp = 0;
static unsigned char __used is_dyn_brkp;

/********************************* String library ****************************/
/* Single-step over library functions creates trap loops. */
@@ -413,18 +414,6 @@ gdb_cris_strtol (const char *s, char **endptr, int base)
}

/********************************** Packet I/O ******************************/
/* Returns the integer equivalent of a hexadecimal character. */
static int
hex (char ch)
{
	if ((ch >= 'a') && (ch <= 'f'))
		return (ch - 'a' + 10);
	if ((ch >= '0') && (ch <= '9'))
		return (ch - '0');
	if ((ch >= 'A') && (ch <= 'F'))
		return (ch - 'A' + 10);
	return (-1);
}

/* Convert the memory, pointed to by mem into hexadecimal representation.
   Put the result in buf, and return a pointer to the last character
@@ -455,22 +444,6 @@ mem2hex(char *buf, unsigned char *mem, int count)
	return (buf);
}

/* Convert the array, in hexadecimal representation, pointed to by buf into
   binary representation. Put the result in mem, and return a pointer to
   the character after the last byte written. */
static unsigned char*
hex2mem (unsigned char *mem, char *buf, int count)
{
	int i;
	unsigned char ch;
	for (i = 0; i < count; i++) {
		ch = hex (*buf++) << 4;
		ch = ch + hex (*buf++);
		*mem++ = ch;
	}
	return (mem);
}

/* Put the content of the array, in binary representation, pointed to by buf
   into memory pointed to by mem, and return a pointer to the character after
   the last byte written.
@@ -524,8 +497,8 @@ getpacket (char *buffer)
		buffer[count] = '\0';
		
		if (ch == '#') {
			xmitcsum = hex (getDebugChar ()) << 4;
			xmitcsum += hex (getDebugChar ());
			xmitcsum = hex_to_bin(getDebugChar()) << 4;
			xmitcsum += hex_to_bin(getDebugChar());
			if (checksum != xmitcsum) {
				/* Wrong checksum */
				putDebugChar ('-');
@@ -599,7 +572,7 @@ putDebugString (const unsigned char *str, int length)

/********************************* Register image ****************************/
/* Write a value to a specified register in the register image of the current
   thread. Returns status code SUCCESS, E02 or E05. */
   thread. Returns status code SUCCESS, E02, E05 or E08. */
static int
write_register (int regno, char *val)
{
@@ -608,8 +581,9 @@ write_register (int regno, char *val)

        if (regno >= R0 && regno <= PC) {
		/* 32-bit register with simple offset. */
		hex2mem ((unsigned char *)current_reg + regno * sizeof(unsigned int),
			 val, sizeof(unsigned int));
		if (hex2bin((unsigned char *)current_reg + regno * sizeof(unsigned int),
			    val, sizeof(unsigned int)))
			status = E08;
	}
        else if (regno == P0 || regno == VR || regno == P4 || regno == P8) {
		/* Do not support read-only registers. */
@@ -618,13 +592,15 @@ write_register (int regno, char *val)
        else if (regno == CCR) {
		/* 16 bit register with complex offset. (P4 is read-only, P6 is not implemented, 
                   and P7 (MOF) is 32 bits in ETRAX 100LX. */
		hex2mem ((unsigned char *)&(current_reg->ccr) + (regno-CCR) * sizeof(unsigned short),
			 val, sizeof(unsigned short));
		if (hex2bin((unsigned char *)&(current_reg->ccr) + (regno-CCR) * sizeof(unsigned short),
			    val, sizeof(unsigned short)))
			status = E08;
	}
	else if (regno >= MOF && regno <= USP) {
		/* 32 bit register with complex offset.  (P8 has been taken care of.) */
		hex2mem ((unsigned char *)&(current_reg->ibr) + (regno-IBR) * sizeof(unsigned int),
			 val, sizeof(unsigned int));
		if (hex2bin((unsigned char *)&(current_reg->ibr) + (regno-IBR) * sizeof(unsigned int),
			    val, sizeof(unsigned int)))
			status = E08;
	} 
        else {
		/* Do not support nonexisting or unimplemented registers (P2, P3, and P6). */
@@ -759,8 +735,10 @@ handle_exception (int sigval)
				/* Write registers. GXX..XX
				   Each byte of register data  is described by two hex digits.
				   Success: OK
				   Failure: void. */
				hex2mem((char *)&cris_reg, &remcomInBuffer[1], sizeof(registers));
				   Failure: E08. */
				if (hex2bin((char *)&cris_reg, &remcomInBuffer[1], sizeof(registers)))
					gdb_cris_strcpy (remcomOutBuffer, error_message[E08]);
				else
					gdb_cris_strcpy (remcomOutBuffer, "OK");
				break;
				
@@ -771,7 +749,7 @@ handle_exception (int sigval)
				   for each byte in the register (target byte order). P1f=11223344 means
				   set register 31 to 44332211.
				   Success: OK
				   Failure: E02, E05 */
				   Failure: E02, E05, E08 */
				{
					char *suffix;
					int regno = gdb_cris_strtol (&remcomInBuffer[1], &suffix, 16);
@@ -791,6 +769,10 @@ handle_exception (int sigval)
							/* Do not support non-existing registers on the stack. */
							gdb_cris_strcpy (remcomOutBuffer, error_message[E07]);
							break;
						case E08:
							/* Invalid parameter. */
							gdb_cris_strcpy (remcomOutBuffer, error_message[E08]);
							break;
						default:
							/* Valid register number. */
							gdb_cris_strcpy (remcomOutBuffer, "OK");
@@ -826,7 +808,7 @@ handle_exception (int sigval)
				   AA..AA is the start address,  LLLL is the number of bytes, and
				   XX..XX is the hexadecimal data.
				   Success: OK
				   Failure: void. */
				   Failure: E08. */
				{
					char *lenptr;
					char *dataptr;
@@ -835,14 +817,15 @@ handle_exception (int sigval)
					int length = gdb_cris_strtol(lenptr+1, &dataptr, 16);
					if (*lenptr == ',' && *dataptr == ':') {
						if (remcomInBuffer[0] == 'M') {
							hex2mem(addr, dataptr + 1, length);
						}
						else /* X */ {
							if (hex2bin(addr, dataptr + 1, length))
								gdb_cris_strcpy (remcomOutBuffer, error_message[E08]);
							else
								gdb_cris_strcpy (remcomOutBuffer, "OK");
						} else /* X */ {
							bin2mem(addr, dataptr + 1, length);
						}
							gdb_cris_strcpy (remcomOutBuffer, "OK");
						}
					else {
					} else {
						gdb_cris_strcpy (remcomOutBuffer, error_message[E06]);
					}
				}
@@ -970,7 +953,7 @@ asm ("\n"
"  move     $ibr,[cris_reg+0x4E]  ; P9,\n"
"  move     $irp,[cris_reg+0x52]  ; P10,\n"
"  move     $srp,[cris_reg+0x56]  ; P11,\n"
"  move     $dtp0,[cris_reg+0x5A] ; P12, register BAR, assembler might not know BAR\n"
"  move     $bar,[cris_reg+0x5A]  ; P12,\n"
"                            ; P13, register DCCR already saved\n"
";; Due to the old assembler-versions BRP might not be recognized\n"
"  .word 0xE670              ; move brp,r0\n"
@@ -1063,7 +1046,7 @@ asm ("\n"
"  move     $ibr,[cris_reg+0x4E]  ; P9,\n"
"  move     $irp,[cris_reg+0x52]  ; P10,\n"
"  move     $srp,[cris_reg+0x56]  ; P11,\n"
"  move     $dtp0,[cris_reg+0x5A] ; P12, register BAR, assembler might not know BAR\n"
"  move     $bar,[cris_reg+0x5A]  ; P12,\n"
"                            ; P13, register DCCR already saved\n"
";; Due to the old assembler-versions BRP might not be recognized\n"
"  .word 0xE670              ; move brp,r0\n"
+3 −11
Original line number Diff line number Diff line
@@ -71,11 +71,7 @@ paging_init(void)
			IO_STATE(R_MMU_KSEG, seg_d, page ) |
			IO_STATE(R_MMU_KSEG, seg_c, page ) |
			IO_STATE(R_MMU_KSEG, seg_b, seg  ) |  /* kernel reg area */
#ifdef CONFIG_JULIETTE
			IO_STATE(R_MMU_KSEG, seg_a, seg  ) |  /* ARTPEC etc. */
#else
			IO_STATE(R_MMU_KSEG, seg_a, page ) |
#endif
			IO_STATE(R_MMU_KSEG, seg_9, seg  ) |  /* LED's on some boards */
			IO_STATE(R_MMU_KSEG, seg_8, seg  ) |  /* CSE0/1, flash and I/O */
			IO_STATE(R_MMU_KSEG, seg_7, page ) |  /* kernel vmalloc area */
@@ -92,11 +88,7 @@ paging_init(void)
			    IO_FIELD(R_MMU_KBASE_HI, base_d, 0x0 ) |
			    IO_FIELD(R_MMU_KBASE_HI, base_c, 0x0 ) |
			    IO_FIELD(R_MMU_KBASE_HI, base_b, 0xb ) |
#ifdef CONFIG_JULIETTE
			    IO_FIELD(R_MMU_KBASE_HI, base_a, 0xa ) |
#else
			    IO_FIELD(R_MMU_KBASE_HI, base_a, 0x0 ) |
#endif
			    IO_FIELD(R_MMU_KBASE_HI, base_9, 0x9 ) |
			    IO_FIELD(R_MMU_KBASE_HI, base_8, 0x8 ) );

+0 −89
Original line number Diff line number Diff line
@@ -10,95 +10,6 @@ config ETRAX_DRAM_VIRTUAL_BASE
	depends on ETRAX_ARCH_V32
	default "c0000000"

choice
	prompt "Nbr of Ethernet LED groups"
	depends on ETRAX_ARCH_V32
	default ETRAX_NBR_LED_GRP_ONE
	help
	  Select how many Ethernet LED groups that can be used. Usually one per Ethernet
	  interface is a good choice.

config	ETRAX_NBR_LED_GRP_ZERO
	bool "Use zero LED groups"
	help
	  Select this if you do not want any Ethernet LEDs.

config	ETRAX_NBR_LED_GRP_ONE
	bool "Use one LED group"
	help
	  Select this if you want one Ethernet LED group. This LED group
	  can be used for one or more Ethernet interfaces. However, it is
	  recommended that each Ethernet interface use a dedicated LED group.

config	ETRAX_NBR_LED_GRP_TWO
	bool "Use two LED groups"
	help
	  Select this if you want two Ethernet LED groups. This is the
	  best choice if you have more than one Ethernet interface and
	  would like to have separate LEDs for the interfaces.

endchoice

config ETRAX_LED_G_NET0
	string "Ethernet LED group 0 green LED bit"
	depends on ETRAX_ARCH_V32 && (ETRAX_NBR_LED_GRP_ONE || ETRAX_NBR_LED_GRP_TWO)
	default "PA3"
	help
	  Bit to use for the green LED in Ethernet LED group 0.

config ETRAX_LED_R_NET0
	string "Ethernet LED group 0 red LED bit"
	depends on ETRAX_ARCH_V32 && (ETRAX_NBR_LED_GRP_ONE || ETRAX_NBR_LED_GRP_TWO)
	default "PA4"
	help
	  Bit to use for the red LED in Ethernet LED group 0.

config ETRAX_LED_G_NET1
	string "Ethernet group 1 green LED bit"
	depends on ETRAX_ARCH_V32 && ETRAX_NBR_LED_GRP_TWO
	default ""
	help
	  Bit to use for the green LED in Ethernet LED group 1.

config ETRAX_LED_R_NET1
	string "Ethernet group 1 red LED bit"
	depends on ETRAX_ARCH_V32 && ETRAX_NBR_LED_GRP_TWO
	default ""
	help
	  Bit to use for the red LED in Ethernet LED group 1.

config ETRAX_V32_LED2G
	string "Second green LED bit"
	depends on ETRAX_ARCH_V32
	default "PA5"
	help
	  Bit to use for the first green LED (status LED).
	  Most Axis products use bit A5 here.

config ETRAX_V32_LED2R
	string "Second red LED bit"
	depends on ETRAX_ARCH_V32
	default "PA6"
	help
	  Bit to use for the first red LED (network LED).
	  Most Axis products use bit A6 here.

config ETRAX_V32_LED3G
	string "Third green LED bit"
	depends on ETRAX_ARCH_V32
	default "PA7"
	help
	  Bit to use for the first green LED (drive/power LED).
	  Most Axis products use bit A7 here.

config ETRAX_V32_LED3R
	string "Third red LED bit"
	depends on ETRAX_ARCH_V32
	default "PA7"
	help
	  Bit to use for the first red LED (drive/power LED).
	  Most Axis products use bit A7 here.

choice
	prompt "Kernel GDB port"
	depends on ETRAX_KGDB
Loading