Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319641
b: refs/heads/master
c: 6cd3c7e
h: refs/heads/master
i:
  319639: 75f5c5d
v: v3
  • Loading branch information
Thomas Langer authored and Ralf Baechle committed Jul 23, 2012
1 parent d7c09ed commit 27144ed
Show file tree
Hide file tree
Showing 12 changed files with 522 additions and 271 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f9c9affc5799b9243d57b86fefda0dffbce3a32e
refs/heads/master: 6cd3c7e2b1dc1e3cc28ffcef074d0b8182b6e501
1 change: 0 additions & 1 deletion trunk/arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ config MACH_JZ4740
select SYS_HAS_CPU_MIPS32_R1
select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_LITTLE_ENDIAN
select SYS_SUPPORTS_ZBOOT_UART16550
select DMA_NONCOHERENT
select IRQ_CPU
select GENERIC_GPIO
Expand Down
4 changes: 0 additions & 4 deletions trunk/arch/mips/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,8 @@ $(obj)/piggy.o: $(obj)/dummy.o $(obj)/vmlinux.bin.z FORCE
# Calculate the load address of the compressed kernel image
hostprogs-y := calc_vmlinuz_load_addr

ifeq ($(CONFIG_MACH_JZ4740),y)
VMLINUZ_LOAD_ADDRESS := 0x80600000
else
VMLINUZ_LOAD_ADDRESS = $(shell $(obj)/calc_vmlinuz_load_addr \
$(obj)/vmlinux.bin $(VMLINUX_LOAD_ADDRESS))
endif

vmlinuzobjs-y += $(obj)/piggy.o

Expand Down
5 changes: 0 additions & 5 deletions trunk/arch/mips/boot/compressed/uart-16550.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
#define PORT(offset) (CKSEG1ADDR(AR7_REGS_UART0) + (4 * offset))
#endif

#ifdef CONFIG_MACH_JZ4740
#define UART0_BASE 0xB0030000
#define PORT(offset) (UART0_BASE + (4 * offset))
#endif

#ifndef PORT
#error please define the serial port address for your own machine
#endif
Expand Down
4 changes: 0 additions & 4 deletions trunk/arch/mips/include/asm/mach-jz4740/jz4740_nand.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>

#define JZ_NAND_NUM_BANKS 4

struct jz_nand_platform_data {
int num_partitions;
struct mtd_partition *partitions;
Expand All @@ -29,8 +27,6 @@ struct jz_nand_platform_data {

unsigned int busy_gpio;

unsigned char banks[JZ_NAND_NUM_BANKS];

void (*ident_callback)(struct platform_device *, struct nand_chip *,
struct mtd_partition **, int *num_partitions);
};
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/mips/jz4740/board-qi_lb60.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ static void qi_lb60_nand_ident(struct platform_device *pdev,
static struct jz_nand_platform_data qi_lb60_nand_pdata = {
.ident_callback = qi_lb60_nand_ident,
.busy_gpio = 94,
.banks = { 1 },
};

/* Keyboard*/
Expand Down
20 changes: 1 addition & 19 deletions trunk/arch/mips/jz4740/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,29 +157,11 @@ static struct resource jz4740_nand_resources[] = {
.flags = IORESOURCE_MEM,
},
{
.name = "bank1",
.name = "bank",
.start = 0x18000000,
.end = 0x180C0000 - 1,
.flags = IORESOURCE_MEM,
},
{
.name = "bank2",
.start = 0x14000000,
.end = 0x140C0000 - 1,
.flags = IORESOURCE_MEM,
},
{
.name = "bank3",
.start = 0x0C000000,
.end = 0x0C0C0000 - 1,
.flags = IORESOURCE_MEM,
},
{
.name = "bank4",
.start = 0x08000000,
.end = 0x080C0000 - 1,
.flags = IORESOURCE_MEM,
},
};

struct platform_device jz4740_nand_device = {
Expand Down
49 changes: 5 additions & 44 deletions trunk/arch/mips/jz4740/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
#include <asm/mach-jz4740/base.h>
#include <asm/mach-jz4740/timer.h>

#include "reset.h"
#include "clock.h"

static void jz4740_halt(void)
{
while (1) {
Expand Down Expand Up @@ -56,57 +53,21 @@ static void jz4740_restart(char *command)
jz4740_halt();
}

#define JZ_REG_RTC_CTRL 0x00
#define JZ_REG_RTC_HIBERNATE 0x20
#define JZ_REG_RTC_WAKEUP_FILTER 0x24
#define JZ_REG_RTC_RESET_COUNTER 0x28
#define JZ_REG_RTC_CTRL 0x00
#define JZ_REG_RTC_HIBERNATE 0x20

#define JZ_RTC_CTRL_WRDY BIT(7)
#define JZ_RTC_WAKEUP_FILTER_MASK 0x0000FFE0
#define JZ_RTC_RESET_COUNTER_MASK 0x00000FE0
#define JZ_RTC_CTRL_WRDY BIT(7)

static inline void jz4740_rtc_wait_ready(void __iomem *rtc_base)
static void jz4740_power_off(void)
{
void __iomem *rtc_base = ioremap(JZ4740_RTC_BASE_ADDR, 0x24);
uint32_t ctrl;

do {
ctrl = readl(rtc_base + JZ_REG_RTC_CTRL);
} while (!(ctrl & JZ_RTC_CTRL_WRDY));
}

static void jz4740_power_off(void)
{
void __iomem *rtc_base = ioremap(JZ4740_RTC_BASE_ADDR, 0x38);
unsigned long wakeup_filter_ticks;
unsigned long reset_counter_ticks;

/*
* Set minimum wakeup pin assertion time: 100 ms.
* Range is 0 to 2 sec if RTC is clocked at 32 kHz.
*/
wakeup_filter_ticks = (100 * jz4740_clock_bdata.rtc_rate) / 1000;
if (wakeup_filter_ticks < JZ_RTC_WAKEUP_FILTER_MASK)
wakeup_filter_ticks &= JZ_RTC_WAKEUP_FILTER_MASK;
else
wakeup_filter_ticks = JZ_RTC_WAKEUP_FILTER_MASK;
jz4740_rtc_wait_ready(rtc_base);
writel(wakeup_filter_ticks, rtc_base + JZ_REG_RTC_WAKEUP_FILTER);

/*
* Set reset pin low-level assertion time after wakeup: 60 ms.
* Range is 0 to 125 ms if RTC is clocked at 32 kHz.
*/
reset_counter_ticks = (60 * jz4740_clock_bdata.rtc_rate) / 1000;
if (reset_counter_ticks < JZ_RTC_RESET_COUNTER_MASK)
reset_counter_ticks &= JZ_RTC_RESET_COUNTER_MASK;
else
reset_counter_ticks = JZ_RTC_RESET_COUNTER_MASK;
jz4740_rtc_wait_ready(rtc_base);
writel(reset_counter_ticks, rtc_base + JZ_REG_RTC_RESET_COUNTER);

jz4740_rtc_wait_ready(rtc_base);
writel(1, rtc_base + JZ_REG_RTC_HIBERNATE);

jz4740_halt();
}

Expand Down
Loading

0 comments on commit 27144ed

Please sign in to comment.