Skip to content

Commit

Permalink
Merge branch 'unicore32' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/epip/linux-2.6-unicore32

* 'unicore32' of git://git.kernel.org/pub/scm/linux/kernel/git/epip/linux-2.6-unicore32:
  unicore32 framebuffer fix: get videomemory by __get_free_pages() and make it floatable
  unicore32 core architecture: remove duplicated #include
  unicore32 rtc driver fix: cleanup irq_set_freq and irq_set_state
  unicore32 fix: remove arch-specific futex support
  unicore32 ldscript fix: add cacheline parameter to PERCPU() macro
  • Loading branch information
Linus Torvalds committed Apr 4, 2011
2 parents 7dbb25a + 6b79474 commit 3230ca9
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 217 deletions.
2 changes: 1 addition & 1 deletion arch/unicore32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ASM_GENERIC_HEADERS += bitsperlong.h bug.h bugs.h
ASM_GENERIC_HEADERS += cputime.h current.h
ASM_GENERIC_HEADERS += device.h div64.h
ASM_GENERIC_HEADERS += emergency-restart.h errno.h
ASM_GENERIC_HEADERS += fb.h fcntl.h ftrace.h
ASM_GENERIC_HEADERS += fb.h fcntl.h ftrace.h futex.h
ASM_GENERIC_HEADERS += hardirq.h hw_irq.h
ASM_GENERIC_HEADERS += ioctl.h ioctls.h ipcbuf.h irq_regs.h
ASM_GENERIC_HEADERS += kdebug.h kmap_types.h
Expand Down
143 changes: 0 additions & 143 deletions arch/unicore32/include/asm/futex.h

This file was deleted.

10 changes: 0 additions & 10 deletions arch/unicore32/include/mach/PKUnity.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@
#define PKUNITY_SDRAM_BASE 0x00000000 /* 0x00000000 - 0x7FFFFFFF 2GB */
#define PKUNITY_MMIO_BASE 0x80000000 /* 0x80000000 - 0xFFFFFFFF 2GB */

/*
* PKUNITY Memory Map Addresses: 0x0D000000 - 0x0EFFFFFF (32MB)
* 0x0D000000 - 0x0DFFFFFF 16MB: for UVC
* 0x0E000000 - 0x0EFFFFFF 16MB: for UNIGFX
*/
#define PKUNITY_UVC_MMAP_BASE 0x0D000000
#define PKUNITY_UVC_MMAP_SIZE 0x01000000 /* 16MB */
#define PKUNITY_UNIGFX_MMAP_BASE 0x0E000000
#define PKUNITY_UNIGFX_MMAP_SIZE 0x01000000 /* 16MB */

/*
* PKUNITY System Bus Addresses (PCI): 0x80000000 - 0xBFFFFFFF (1GB)
* 0x80000000 - 0x8000000B 12B PCI Configuration regs
Expand Down
1 change: 0 additions & 1 deletion arch/unicore32/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ void puv3_pci_adjust_zones(unsigned long *size, unsigned long *holes);

/* kuser area */
#define KUSER_VECPAGE_BASE (KUSER_BASE + UL(0x3fff0000))
#define KUSER_UNIGFX_BASE (PAGE_OFFSET + PKUNITY_UNIGFX_MMAP_BASE)
/* kuser_vecpage (0xbfff0000) is ro, and vectors page (0xffff0000) is rw */
#define kuser_vecpage_to_vectors(x) ((x) - (KUSER_VECPAGE_BASE) \
+ (VECTORS_BASE))
Expand Down
5 changes: 0 additions & 5 deletions arch/unicore32/kernel/puv3-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ static struct resource puv3_unigfx_resources[] = {
.end = io_v2p(PKUNITY_UNIGFX_BASE) + 0xfff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = PKUNITY_UNIGFX_MMAP_BASE,
.end = PKUNITY_UNIGFX_MMAP_BASE + PKUNITY_UNIGFX_MMAP_SIZE,
.flags = IORESOURCE_MEM,
},
};

static struct resource puv3_rtc_resources[] = {
Expand Down
9 changes: 0 additions & 9 deletions arch/unicore32/kernel/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ static int puv3_rtc_setpie(struct device *dev, int enabled)
return 0;
}

static int puv3_rtc_setfreq(struct device *dev, int freq)
{
return 0;
}

/* Time read/write */

static int puv3_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm)
Expand Down Expand Up @@ -214,8 +209,6 @@ static const struct rtc_class_ops puv3_rtcops = {
.set_time = puv3_rtc_settime,
.read_alarm = puv3_rtc_getalarm,
.set_alarm = puv3_rtc_setalarm,
.irq_set_freq = puv3_rtc_setfreq,
.irq_set_state = puv3_rtc_setpie,
.proc = puv3_rtc_proc,
};

Expand Down Expand Up @@ -294,8 +287,6 @@ static int puv3_rtc_probe(struct platform_device *pdev)

puv3_rtc_enable(pdev, 1);

puv3_rtc_setfreq(&pdev->dev, 1);

/* register RTC and exit */

rtc = rtc_device_register("pkunity", &pdev->dev, &puv3_rtcops,
Expand Down
15 changes: 2 additions & 13 deletions arch/unicore32/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
* Standard memory resources
*/
static struct resource mem_res[] = {
{
.name = "Video RAM",
.start = 0,
.end = 0,
.flags = IORESOURCE_MEM
},
{
.name = "Kernel text",
.start = 0,
Expand All @@ -83,9 +77,8 @@ static struct resource mem_res[] = {
}
};

#define video_ram mem_res[0]
#define kernel_code mem_res[1]
#define kernel_data mem_res[2]
#define kernel_code mem_res[0]
#define kernel_data mem_res[1]

/*
* These functions re-use the assembly code in head.S, which
Expand Down Expand Up @@ -224,10 +217,6 @@ request_standard_resources(struct meminfo *mi)
kernel_data.end <= res->end)
request_resource(res, &kernel_data);
}

video_ram.start = PKUNITY_UNIGFX_MMAP_BASE;
video_ram.end = PKUNITY_UNIGFX_MMAP_BASE + PKUNITY_UNIGFX_MMAP_SIZE;
request_resource(&iomem_resource, &video_ram);
}

static void (*init_machine)(void) __initdata;
Expand Down
1 change: 0 additions & 1 deletion arch/unicore32/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <linux/delay.h>
#include <linux/hardirq.h>
#include <linux/init.h>
#include <linux/uaccess.h>
#include <linux/atomic.h>
#include <linux/unistd.h>

Expand Down
7 changes: 4 additions & 3 deletions arch/unicore32/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <asm/thread_info.h>
#include <asm/memory.h>
#include <asm/page.h>
#include <asm/cache.h>

OUTPUT_ARCH(unicore32)
ENTRY(stext)
Expand All @@ -29,7 +30,7 @@ SECTIONS
HEAD_TEXT_SECTION
INIT_TEXT_SECTION(PAGE_SIZE)
INIT_DATA_SECTION(16)
PERCPU(PAGE_SIZE)
PERCPU(L1_CACHE_BYTES, PAGE_SIZE)
__init_end = .;

_stext = .;
Expand All @@ -45,10 +46,10 @@ SECTIONS

_sdata = .;
RO_DATA_SECTION(PAGE_SIZE)
RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
_edata = .;

EXCEPTION_TABLE(32)
EXCEPTION_TABLE(L1_CACHE_BYTES)
NOTES

BSS_SECTION(0, 0, 0)
Expand Down
20 changes: 0 additions & 20 deletions arch/unicore32/mm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,6 @@ void __init uc32_mm_memblock_reserve(void)
* and can only be in node 0.
*/
memblock_reserve(__pa(swapper_pg_dir), PTRS_PER_PGD * sizeof(pgd_t));

#ifdef CONFIG_PUV3_UNIGFX
/*
* These should likewise go elsewhere. They pre-reserve the
* screen/video memory region at the 48M~64M of main system memory.
*/
memblock_reserve(PKUNITY_UNIGFX_MMAP_BASE, PKUNITY_UNIGFX_MMAP_SIZE);
memblock_reserve(PKUNITY_UVC_MMAP_BASE, PKUNITY_UVC_MMAP_SIZE);
#endif
}

/*
Expand All @@ -370,17 +361,6 @@ static void __init devicemaps_init(void)
for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE)
pmd_clear(pmd_off_k(addr));

/*
* Create a mapping for UniGFX VRAM
*/
#ifdef CONFIG_PUV3_UNIGFX
map.pfn = __phys_to_pfn(PKUNITY_UNIGFX_MMAP_BASE);
map.virtual = KUSER_UNIGFX_BASE;
map.length = PKUNITY_UNIGFX_MMAP_SIZE;
map.type = MT_KUSER;
create_mapping(&map);
#endif

/*
* Create a mapping for the machine vectors at the high-vectors
* location (0xffff0000). If we aren't using high-vectors, also
Expand Down
28 changes: 17 additions & 11 deletions drivers/video/fb-puv3.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/vmalloc.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/fb.h>
Expand Down Expand Up @@ -531,7 +530,7 @@ static int unifb_set_par(struct fb_info *info)
return -EINVAL;
}

writel(PKUNITY_UNIGFX_MMAP_BASE, UDE_FSA);
writel(info->fix.smem_start, UDE_FSA);
writel(info->var.yres, UDE_LS);
writel(get_line_length(info->var.xres,
info->var.bits_per_pixel) >> 3, UDE_PS);
Expand Down Expand Up @@ -680,13 +679,27 @@ static int unifb_probe(struct platform_device *dev)
struct fb_info *info;
u32 unifb_regs[UNIFB_REGS_NUM];
int retval = -ENOMEM;
struct resource *iomem, *mapmem;
struct resource *iomem;
void *videomemory;

videomemory = (void *)__get_free_pages(GFP_KERNEL | __GFP_COMP,
get_order(UNIFB_MEMSIZE));
if (!videomemory)
goto err;

memset(videomemory, 0, UNIFB_MEMSIZE);

unifb_fix.smem_start = virt_to_phys(videomemory);
unifb_fix.smem_len = UNIFB_MEMSIZE;

iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
unifb_fix.mmio_start = iomem->start;

info = framebuffer_alloc(sizeof(u32)*256, &dev->dev);
if (!info)
goto err;

info->screen_base = (char __iomem *)KUSER_UNIGFX_BASE;
info->screen_base = (char __iomem *)videomemory;
info->fbops = &unifb_ops;

retval = fb_find_mode(&info->var, info, NULL,
Expand All @@ -695,13 +708,6 @@ static int unifb_probe(struct platform_device *dev)
if (!retval || (retval == 4))
info->var = unifb_default;

iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
unifb_fix.mmio_start = iomem->start;

mapmem = platform_get_resource(dev, IORESOURCE_MEM, 1);
unifb_fix.smem_start = mapmem->start;
unifb_fix.smem_len = UNIFB_MEMSIZE;

info->fix = unifb_fix;
info->pseudo_palette = info->par;
info->par = NULL;
Expand Down

0 comments on commit 3230ca9

Please sign in to comment.