Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chip2chip #43

Open
wants to merge 48 commits into
base: driver_chip2chip
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
089c9f7
added chip2chip device codes. NOT TESTED
yunekorea May 4, 2023
52791a8
fixed a string in the module list
yunekorea May 8, 2023
767afca
fixed chip2chip_base's scope issues
yunekorea May 8, 2023
5e06929
added dynamic page size reading n writing for chip2chip_base.h
yunekorea May 8, 2023
9bad04d
fixed errors
yunekorea May 8, 2023
bb3560c
fixed error
yunekorea May 8, 2023
79e8c87
fixed Makefile
yunekorea May 9, 2023
ed28e2e
segragated function definition in chip2chip_base.h
yunekorea May 9, 2023
69c5656
added chip2chip_base.c
yunekorea May 9, 2023
2901266
moved FD, vptr structure to chip2chip_base.c
yunekorea May 9, 2023
e2f4a80
header include for chip2chip_base.c
yunekorea May 9, 2023
c78179a
temporarly added a mutex for erase operation
yunekorea May 9, 2023
a6ffc36
added chip2chip test code in test directory
yunekorea May 15, 2023
5dfb9b1
added chip2chip-test.out option for Makefile. fixed a mutex error in …
yunekorea May 15, 2023
33db2bf
Modified chip2chip-test.c for more adequate testing. Disabled chip2ch…
yunekorea May 17, 2023
dddd4b9
fixed typos
yunekorea May 18, 2023
06061ce
chip2chip-test.c : erase test is done before write test
yunekorea May 18, 2023
eb08ad3
Changed the optimization option in CFLAGS, which has fixed an local v…
yunekorea May 26, 2023
956559e
Fixed a confliction in Makfile. Modified chip2chip_erase's returning …
yunekorea May 26, 2023
6eb0f2f
Merge branch 'main' into chip2chip
yunekorea May 26, 2023
4ff8b8c
Changed the title of source code 'chip2chip_base.*' to 'chip2chip_cor…
yunekorea May 27, 2023
01221c3
Removed unnecessary comments in Makefile.
yunekorea May 27, 2023
b5328dc
Removed unnecessary comments in chip2chip*.*. Some are remaining for …
yunekorea May 27, 2023
fd53d99
Temporarily added some functions to print the size of write buffers
yunekorea May 30, 2023
c621b1f
Size of buffer allocation in chip2chip_device_init is fixed set to 81…
yunekorea Jun 1, 2023
f539f8c
Test program will commit WnR in block unit
yunekorea Jun 7, 2023
b788eed
Modified the c2c test file so that it could only test erase and read.
yunekorea Jul 7, 2023
c77e27f
Print data in the buffer while an erase test in chip2chip-test.c
yunekorea Jul 17, 2023
2cc1354
Fixed 'test_full_write' function in chip2chip-test.c. Now does write …
yunekorea Jul 18, 2023
e3daa35
Added a function that tests only Read function of c2c interface in ch…
yunekorea Jul 19, 2023
5157dd3
Fixed minor data type errors in chip2chip_core.c
yunekorea Jul 19, 2023
8bf9001
chip2chip.c : test_full_write does the test writing with numbers star…
yunekorea Jul 19, 2023
0629d08
Changed the buffer's IO size to match with the OOB area's data IO
yunekorea Jul 20, 2023
ebd3bf4
Moved the optimization parameter so that it would be set as O0 only w…
yunekorea Jul 27, 2023
a5de108
Changed the ifndef text from CHIP2CHIPBASE_H to CHIP2CHIPCORE_H
yunekorea Jul 27, 2023
fd4491d
Removed unnecessary commments in device/chip2chip/chip2chip_core.c.
yunekorea Jul 27, 2023
99a7842
CTC_In,Out will utilize volatile variable.
yunekorea Jul 28, 2023
b57208b
Changed buffer copy functions in chip2chip.c to static ones.
yunekorea Jul 28, 2023
4812029
Page size will be 8224 only when using chip2chip device which utilize…
yunekorea Jul 28, 2023
2c7244f
Changed the block number for each chip in chip2chip interface to 8192…
yunekorea Aug 7, 2023
a667412
chip2chip-test will test read,write functionality in a block unit whi…
yunekorea Aug 10, 2023
d706b21
chip2chip_clear won't return -1 when a block erase returns an error b…
yunekorea Aug 17, 2023
9d4cf4a
chip2chip_clear will set the bits of a badseg_bitmap.
yunekorea Aug 21, 2023
3194b76
Added a dirty segment bitmap to chip2chip's private structure.
yunekorea Sep 7, 2023
4c92bd3
Added initialization/termination functions in chip2chip_open/close.
yunekorea Sep 8, 2023
91f5452
Added file operations for saving and loading the bad/dirty segments b…
yunekorea Sep 11, 2023
9e96373
Added a function that initializes a bad segment bitmap.
yunekorea Oct 5, 2023
e91c970
Moved the set_badseg_bitmap function so that it will be called after …
yunekorea Oct 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions device/chip2chip/chip2chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,9 @@ int chip2chip_open(struct device *dev, const char *name, int flags)
}

if (c2c->o_flags & O_CREAT) {
chip2chip_clear(dev);
//chip2chip_clear(dev);
sleep(1);
chip2chip_wait_erase_finish(dev, 0, nr_segments);
//chip2chip_wait_erase_finish(dev, 0, nr_segments);
}

return 0;
Expand Down
66 changes: 62 additions & 4 deletions test/chip2chip-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ void test_full_write(void)
memset(buffer, 0, page_size);

/**< note that all I/O functions run synchronously */
/*
for (addr.lpn = 0; addr.lpn < total_pages; addr.lpn++) {
memcpy(buffer, &addr.lpn, sizeof(uint32_t));
request.paddr = addr;
Expand All @@ -65,8 +66,23 @@ void test_full_write(void)
TEST_ASSERT_EQUAL_INT(request.data_len,
dev->d_op->write(dev, &request));
}
*/

addr.format.bus = 1;
addr.format.chip = 2;
addr.format.block = 3;
memcpy(buffer, &addr.lpn, sizeof(uint32_t));
request.paddr = addr;
request.data_len = page_size;
request.end_rq = NULL;
request.flag = DEVICE_WRITE;
request.sector = 0;
request.data = buffer;
TEST_ASSERT_EQUAL_INT(request.data_len,
dev->d_op->write(dev, &request));

memset(buffer, 0, page_size);
/*
for (addr.lpn = 0; addr.lpn < total_pages; addr.lpn++) {
request.paddr = addr;
request.data_len = page_size;
Expand All @@ -78,6 +94,16 @@ void test_full_write(void)
dev->d_op->read(dev, &request));
TEST_ASSERT_EQUAL_UINT32(addr.lpn, *(uint32_t *)request.data);
}
*/

request.data_len = page_size;
request.endrq = NULL;
request.flag = DEVICE_READ;
request.sector = 0;
request.data = buffer;
TEST_ASSERT_EQUAL_INT(request.data_len,
dev->d_op->read(dev, &request));
TEST_ASSERT_EQUAL_UINT32(addr.lpn, *(uint32_t *)request.data);

TEST_ASSERT_EQUAL_INT(0, dev->d_op->close(dev));
free(buffer);
Expand Down Expand Up @@ -146,6 +172,7 @@ void test_erase(void)
memset(buffer, 0, page_size);

/**< note that all I/O functions run synchronously */
/*
for (addr.lpn = 0; addr.lpn < total_pages; addr.lpn++) {
memcpy(buffer, &addr.lpn, sizeof(uint32_t));
request.paddr = addr;
Expand All @@ -167,7 +194,22 @@ void test_erase(void)
request.end_rq = NULL;
TEST_ASSERT_EQUAL_INT(0, dev->d_op->erase(dev, &request));
};

*/


addr.lpn = 0;
addr.format.block = 3;
memcpy(buffer, &addr.lpn, sizeof(uint32_t));
request.paddr = addr;
request.data_len = page_size;
request.end_rq = NULL;
request.flag = DEVICE_ERASE;
request.sector = 0;
request.data = buffer;
TEST_ASSERT_EQUAL_INT(request.data_len,
dev->d_op->erase(dev, &request));

/*
nr_pages_per_segment = device_get_pages_per_segment(dev);
for (addr.lpn = 0; addr.lpn < total_pages - nr_pages_per_segment;
addr.lpn++) {
Expand All @@ -181,7 +223,7 @@ void test_erase(void)
TEST_ASSERT_EQUAL_INT(request.data_len,
dev->d_op->write(dev, &request));
}

for (; addr.lpn < total_pages; addr.lpn++) {
memcpy(buffer, &addr.lpn, sizeof(uint32_t));
request.paddr = addr;
Expand All @@ -192,6 +234,22 @@ void test_erase(void)
request.data = buffer;
TEST_ASSERT_EQUAL_INT(-EINVAL, dev->d_op->write(dev, &request));
}
*/

addr.format.bus = 1;
addr.format.chip = 2;
addr.format.block = 3;
request..paddr = addr;
BlaCkinkGJ marked this conversation as resolved.
Show resolved Hide resolved
request.data_len = page_size;
request.endrq = NULL;
request.flag = DEVICE_READ;
request.sector = 0;
request.data = buffer;
TEST_ASSERT_EQUAL_INT(request.data_len,
dev->d_op->read(dev, &request));
TEST_ASSERT_EQUAL_UINT32(addr.lpn, *(uint32_t *)request.data);



TEST_ASSERT_EQUAL_INT(0, dev->d_op->close(dev));
free(buffer);
Expand Down Expand Up @@ -290,8 +348,8 @@ int main(void)
UNITY_BEGIN();
RUN_TEST(test_open);
RUN_TEST(test_full_write);
RUN_TEST(test_overwrite);
//RUN_TEST(test_overwrite);
RUN_TEST(test_erase);
RUN_TEST(test_end_rq_works);
//RUN_TEST(test_end_rq_works);
return UNITY_END();
}