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

Commit 239fd459 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
  [POWERPC] cell: set ARCH_SPARSEMEM_DEFAULT in Kconfig
  [POWERPC] Fix cell "new style" mapping and add debug
  [POWERPC] pseries: Force 4k update_flash block and list sizes
  [POWERPC] CPM_UART: Fix non-console initialisation
  [POWERPC] CPM_UART: Fix non-console transmit
  [POWERPC] Make sure initrd and dtb sections get into zImage correctly
parents eea2078e 36b600f2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -740,7 +740,7 @@ config ARCH_SPARSEMEM_ENABLE

config ARCH_SPARSEMEM_DEFAULT
	def_bool y
	depends on SMP && PPC_PSERIES
	depends on (SMP && PPC_PSERIES) || PPC_CELL

config ARCH_POPULATES_NODE_MAP
	def_bool y
+2 −2
Original line number Diff line number Diff line
@@ -179,11 +179,11 @@ if [ -z "$cacheit" ]; then
fi

if [ -n "$initrd" ]; then
    addsec $tmp "$initrd" initrd
    addsec $tmp "$initrd" $isection
fi

if [ -n "$dtb" ]; then
    addsec $tmp "$dtb" dtb
    addsec $tmp "$dtb" .kernel:dtb
fi

if [ "$platform" != "miboot" ]; then
+5 −0
Original line number Diff line number Diff line
@@ -21,6 +21,11 @@ SECTIONS
    __got2_end = .;
  }

  . = ALIGN(8);
  _dtb_start = .;
  .kernel:dtb : { *(.kernel:dtb) }
  _dtb_end = .;

  . = ALIGN(4096);
  _vmlinux_start =  .;
  .kernel:vmlinux.strip : { *(.kernel:vmlinux.strip) }
+37 −10
Original line number Diff line number Diff line
@@ -72,6 +72,10 @@
#define VALIDATE_BUF_SIZE 4096    
#define RTAS_MSG_MAXLEN   64

/* Quirk - RTAS requires 4k list length and block size */
#define RTAS_BLKLIST_LENGTH 4096
#define RTAS_BLK_SIZE 4096

struct flash_block {
	char *data;
	unsigned long length;
@@ -83,7 +87,7 @@ struct flash_block {
 * into a version/length and translate the pointers
 * to absolute.
 */
#define FLASH_BLOCKS_PER_NODE ((PAGE_SIZE - 16) / sizeof(struct flash_block))
#define FLASH_BLOCKS_PER_NODE ((RTAS_BLKLIST_LENGTH - 16) / sizeof(struct flash_block))
struct flash_block_list {
	unsigned long num_blocks;
	struct flash_block_list *next;
@@ -96,6 +100,9 @@ struct flash_block_list_header { /* just the header of flash_block_list */

static struct flash_block_list_header rtas_firmware_flash_list = {0, NULL};

/* Use slab cache to guarantee 4k alignment */
static kmem_cache_t *flash_block_cache = NULL;

#define FLASH_BLOCK_LIST_VERSION (1UL)

/* Local copy of the flash block list.
@@ -153,7 +160,7 @@ static int flash_list_valid(struct flash_block_list *flist)
				return FLASH_IMG_NULL_DATA;
			}
			block_size = f->blocks[i].length;
			if (block_size <= 0 || block_size > PAGE_SIZE) {
			if (block_size <= 0 || block_size > RTAS_BLK_SIZE) {
				return FLASH_IMG_BAD_LEN;
			}
			image_size += block_size;
@@ -177,9 +184,9 @@ static void free_flash_list(struct flash_block_list *f)

	while (f) {
		for (i = 0; i < f->num_blocks; i++)
			free_page((unsigned long)(f->blocks[i].data));
			kmem_cache_free(flash_block_cache, f->blocks[i].data);
		next = f->next;
		free_page((unsigned long)f);
		kmem_cache_free(flash_block_cache, f);
		f = next;
	}
}
@@ -278,6 +285,12 @@ static ssize_t rtas_flash_read(struct file *file, char __user *buf,
	return msglen;
}

/* constructor for flash_block_cache */
void rtas_block_ctor(void *ptr, kmem_cache_t *cache, unsigned long flags)
{
	memset(ptr, 0, RTAS_BLK_SIZE);
}

/* We could be much more efficient here.  But to keep this function
 * simple we allocate a page to the block list no matter how small the
 * count is.  If the system is low on memory it will be just as well
@@ -302,7 +315,7 @@ static ssize_t rtas_flash_write(struct file *file, const char __user *buffer,
	 * proc file
	 */
	if (uf->flist == NULL) {
		uf->flist = (struct flash_block_list *) get_zeroed_page(GFP_KERNEL);
		uf->flist = kmem_cache_alloc(flash_block_cache, GFP_KERNEL);
		if (!uf->flist)
			return -ENOMEM;
	}
@@ -313,21 +326,21 @@ static ssize_t rtas_flash_write(struct file *file, const char __user *buffer,
	next_free = fl->num_blocks;
	if (next_free == FLASH_BLOCKS_PER_NODE) {
		/* Need to allocate another block_list */
		fl->next = (struct flash_block_list *)get_zeroed_page(GFP_KERNEL);
		fl->next = kmem_cache_alloc(flash_block_cache, GFP_KERNEL);
		if (!fl->next)
			return -ENOMEM;
		fl = fl->next;
		next_free = 0;
	}

	if (count > PAGE_SIZE)
		count = PAGE_SIZE;
	p = (char *)get_zeroed_page(GFP_KERNEL);
	if (count > RTAS_BLK_SIZE)
		count = RTAS_BLK_SIZE;
	p = kmem_cache_alloc(flash_block_cache, GFP_KERNEL);
	if (!p)
		return -ENOMEM;
	
	if(copy_from_user(p, buffer, count)) {
		free_page((unsigned long)p);
		kmem_cache_free(flash_block_cache, p);
		return -EFAULT;
	}
	fl->blocks[next_free].data = p;
@@ -791,6 +804,16 @@ int __init rtas_flash_init(void)
		goto cleanup;

	rtas_flash_term_hook = rtas_flash_firmware;

	flash_block_cache = kmem_cache_create("rtas_flash_cache",
				RTAS_BLK_SIZE, RTAS_BLK_SIZE, 0,
				rtas_block_ctor, NULL);
	if (!flash_block_cache) {
		printk(KERN_ERR "%s: failed to create block cache\n",
				__FUNCTION__);
		rc = -ENOMEM;
		goto cleanup;
	}
	return 0;

cleanup:
@@ -805,6 +828,10 @@ int __init rtas_flash_init(void)
void __exit rtas_flash_cleanup(void)
{
	rtas_flash_term_hook = NULL;

	if (flash_block_cache)
		kmem_cache_destroy(flash_block_cache);

	remove_flash_pde(firmware_flash_pde);
	remove_flash_pde(firmware_update_pde);
	remove_flash_pde(validate_pde);
+33 −8
Original line number Diff line number Diff line
@@ -655,15 +655,20 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)

	for (i=0; i < 3; i++) {
		ret = of_irq_map_one(np, i, &oirq);
		if (ret)
		if (ret) {
			pr_debug("spu_new: failed to get irq %d\n", i);
			goto err;

		}
		ret = -EINVAL;
		pr_debug("  irq %d no 0x%x on %s\n", i, oirq.specifier[0],
			 oirq.controller->full_name);
		spu->irqs[i] = irq_create_of_mapping(oirq.controller,
					oirq.specifier, oirq.size);
		if (spu->irqs[i] == NO_IRQ)
		if (spu->irqs[i] == NO_IRQ) {
			pr_debug("spu_new: failed to map it !\n");
			goto err;
		}
	}
	return 0;

err:
@@ -681,7 +686,7 @@ static int spu_map_resource(struct device_node *node, int nr,
	struct resource resource = { };
	int ret;

	ret = of_address_to_resource(node, 0, &resource);
	ret = of_address_to_resource(node, nr, &resource);
	if (ret)
		goto out;

@@ -704,22 +709,42 @@ static int __init spu_map_device(struct spu *spu, struct device_node *node)

	ret = spu_map_resource(node, 0, (void __iomem**)&spu->local_store,
					&spu->local_store_phys);
	if (ret)
	if (ret) {
		pr_debug("spu_new: failed to map %s resource 0\n",
			 node->full_name);
		goto out;
	}
	ret = spu_map_resource(node, 1, (void __iomem**)&spu->problem,
					&spu->problem_phys);
	if (ret)
	if (ret) {
		pr_debug("spu_new: failed to map %s resource 1\n",
			 node->full_name);
		goto out_unmap;
	}
	ret = spu_map_resource(node, 2, (void __iomem**)&spu->priv2,
					NULL);
	if (ret)
	if (ret) {
		pr_debug("spu_new: failed to map %s resource 2\n",
			 node->full_name);
		goto out_unmap;
	}

	if (!firmware_has_feature(FW_FEATURE_LPAR))
		ret = spu_map_resource(node, 3, (void __iomem**)&spu->priv1,
					NULL);
	if (ret)
	if (ret) {
		pr_debug("spu_new: failed to map %s resource 3\n",
			 node->full_name);
		goto out_unmap;
	}
	pr_debug("spu_new: %s maps:\n", node->full_name);
	pr_debug("  local store   : 0x%016lx -> 0x%p\n",
		 spu->local_store_phys, spu->local_store);
	pr_debug("  problem state : 0x%016lx -> 0x%p\n",
		 spu->problem_phys, spu->problem);
	pr_debug("  priv2         :                       0x%p\n", spu->priv2);
	pr_debug("  priv1         :                       0x%p\n", spu->priv1);

	return 0;

out_unmap:
Loading