Lines Matching refs:size
97 * As GPMC minimum partition size is 16MB we can only start from
841 static int gpmc_cs_set_memconf(int cs, u32 base, u32 size)
848 * boundary equal to or greater than size.
850 if (base & (size - 1))
854 mask = (1 << GPMC_SECTION_SHIFT) - size;
886 static void gpmc_cs_get_memconf(int cs, u32 *base, u32 *size)
894 *size = (1 << GPMC_SECTION_SHIFT) - (mask << GPMC_CHUNK_SHIFT);
919 static unsigned long gpmc_mem_align(unsigned long size)
923 size = (size - 1) >> (GPMC_CHUNK_SHIFT - 1);
926 size >>= 1;
928 } while (size);
929 size = 1 << order;
930 return size;
933 static int gpmc_cs_insert_mem(int cs, unsigned long base, unsigned long size)
939 size = gpmc_mem_align(size);
942 res->end = base + size - 1;
964 int gpmc_cs_request(int cs, unsigned long size, unsigned long *base)
974 size = gpmc_mem_align(size);
975 if (size > (1 << GPMC_SECTION_SHIFT))
984 r = adjust_resource(res, res->start & ~(size - 1), size);
986 r = allocate_resource(&gpmc_mem_root, res, size, 0, ~0,
987 size, NULL, NULL);
991 /* Disable CS while changing base address and size mask */
1464 u32 base, size;
1468 gpmc_cs_get_memconf(cs, &base, &size);
1469 if (gpmc_cs_insert_mem(cs, base, size)) {
1471 __func__, cs, base, base + size);
1916 u32 old_base, size;
1930 gpmc_cs_get_memconf(cs, &old_base, &size);
1938 ret = gpmc_cs_insert_mem(cs, base, size);
1942 ret = gpmc_cs_set_memconf(cs, base, size);