mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-18 18:59:44 +00:00
83d290c56f
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
64 lines
1.6 KiB
C
64 lines
1.6 KiB
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* (C) Copyright 2011 - 2012 Samsung Electronics
|
|
* EXT4 filesystem implementation in Uboot by
|
|
* Uma Shankar <uma.shankar@samsung.com>
|
|
* Manjunatha C Achar <a.manjunatha@samsung.com>
|
|
*
|
|
* made from existing ext2/dev.c file of Uboot
|
|
* (C) Copyright 2004
|
|
* esd gmbh <www.esd-electronics.com>
|
|
* Reinhard Arlt <reinhard.arlt@esd-electronics.com>
|
|
*
|
|
* based on code of fs/reiserfs/dev.c by
|
|
*
|
|
* (C) Copyright 2003 - 2004
|
|
* Sysgo AG, <www.elinos.com>, Pavel Bartusek <pba@sysgo.com>
|
|
*/
|
|
|
|
/*
|
|
* Changelog:
|
|
* 0.1 - Newly created file for ext4fs support. Taken from
|
|
* fs/ext2/dev.c file in uboot.
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <blk.h>
|
|
#include <config.h>
|
|
#include <fs_internal.h>
|
|
#include <ext4fs.h>
|
|
#include <ext_common.h>
|
|
#include "ext4_common.h"
|
|
|
|
lbaint_t part_offset;
|
|
|
|
static struct blk_desc *ext4fs_blk_desc;
|
|
static disk_partition_t *part_info;
|
|
|
|
void ext4fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
|
|
{
|
|
assert(rbdd->blksz == (1 << rbdd->log2blksz));
|
|
ext4fs_blk_desc = rbdd;
|
|
get_fs()->dev_desc = rbdd;
|
|
part_info = info;
|
|
part_offset = info->start;
|
|
get_fs()->total_sect = ((uint64_t)info->size * info->blksz) >>
|
|
get_fs()->dev_desc->log2blksz;
|
|
}
|
|
|
|
int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len,
|
|
char *buffer)
|
|
{
|
|
return fs_devread(get_fs()->dev_desc, part_info, sector, byte_offset,
|
|
byte_len, buffer);
|
|
}
|
|
|
|
int ext4_read_superblock(char *buffer)
|
|
{
|
|
struct ext_filesystem *fs = get_fs();
|
|
int sect = SUPERBLOCK_START >> fs->dev_desc->log2blksz;
|
|
int off = SUPERBLOCK_START % fs->dev_desc->blksz;
|
|
|
|
return ext4fs_devread(sect, off, SUPERBLOCK_SIZE,
|
|
buffer);
|
|
}
|